@@ -67,7 +67,7 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult<Response> {
6767
6868 let mut resp = Response :: with ( ( status:: Found , Redirect ( url) ) ) ;
6969 resp. extensions
70- . insert :: < CachePolicy > ( CachePolicy :: ForeverOnlyInCdn ) ;
70+ . insert :: < CachePolicy > ( CachePolicy :: ForeverInCdn ) ;
7171 Ok ( resp)
7272 }
7373
@@ -190,7 +190,7 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult<Response> {
190190 } ;
191191
192192 let cache = if version == "latest" {
193- CachePolicy :: ForeverOnlyInCdn
193+ CachePolicy :: ForeverInCdn
194194 } else {
195195 CachePolicy :: ForeverInCdnAndStaleInBrowser
196196 } ;
@@ -263,7 +263,7 @@ impl RustdocPage {
263263 let mut response = Response :: with ( ( Status :: Ok , html) ) ;
264264 response. headers . set ( ContentType :: html ( ) ) ;
265265 response. extensions . insert :: < CachePolicy > ( if is_latest_url {
266- CachePolicy :: ForeverOnlyInCdn
266+ CachePolicy :: ForeverInCdn
267267 } else {
268268 CachePolicy :: ForeverInCdnAndStaleInBrowser
269269 } ) ;
@@ -356,7 +356,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
356356 // to prevent cloudfront caching the wrong artifacts on URLs with loose semver
357357 // versions, redirect the browser to the returned version instead of loading it
358358 // immediately
359- return redirect ( & name, & v, & req_path, CachePolicy :: ForeverOnlyInCdn ) ;
359+ return redirect ( & name, & v, & req_path, CachePolicy :: ForeverInCdn ) ;
360360 }
361361 } ;
362362
@@ -387,7 +387,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
387387 & name,
388388 & version_or_latest,
389389 & req_path[ 1 ..] ,
390- CachePolicy :: ForeverOnlyInCdn ,
390+ CachePolicy :: ForeverInCdn ,
391391 ) ;
392392 }
393393
@@ -427,7 +427,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
427427 & name,
428428 & version_or_latest,
429429 & req_path,
430- CachePolicy :: ForeverOnlyInCdn ,
430+ CachePolicy :: ForeverInCdn ,
431431 )
432432 } else if req_path. first ( ) . map_or ( false , |p| p. contains ( '-' ) ) {
433433 // This is a target, not a module; it may not have been built.
@@ -436,7 +436,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
436436 & format ! ( "/crate/{}" , name) ,
437437 & format ! ( "{}/target-redirect" , version) ,
438438 & req_path,
439- CachePolicy :: ForeverOnlyInCdn ,
439+ CachePolicy :: ForeverInCdn ,
440440 )
441441 } else {
442442 Err ( Nope :: ResourceNotFound . into ( ) )
@@ -456,7 +456,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
456456 // which means we cache slightly different for `/latest/` and
457457 // URLs with versions.
458458 response. extensions . insert :: < CachePolicy > ( if is_latest_url {
459- CachePolicy :: ForeverOnlyInCdn
459+ CachePolicy :: ForeverInCdn
460460 } else {
461461 CachePolicy :: ForeverInCdnAndStaleInBrowser
462462 } ) ;
@@ -701,7 +701,7 @@ pub fn target_redirect_handler(req: &mut Request) -> IronResult<Response> {
701701 let url = ctry ! ( req, Url :: parse( & url) ) ;
702702 let mut resp = Response :: with ( ( status:: Found , Redirect ( url) ) ) ;
703703 resp. extensions . insert :: < CachePolicy > ( if is_latest_url {
704- CachePolicy :: ForeverOnlyInCdn
704+ CachePolicy :: ForeverInCdn
705705 } else {
706706 CachePolicy :: ForeverInCdnAndStaleInBrowser
707707 } ) ;
@@ -788,7 +788,7 @@ mod test {
788788 . next ( )
789789 {
790790 let link = elem. attributes . borrow ( ) . get ( "href" ) . unwrap ( ) . to_string ( ) ;
791- assert_success_cached ( & link, web, CachePolicy :: ForeverOnlyInCdn , config) ?;
791+ assert_success_cached ( & link, web, CachePolicy :: ForeverInCdn , config) ?;
792792 Ok ( Some ( link) )
793793 } else {
794794 Ok ( None )
@@ -898,7 +898,7 @@ mod test {
898898 assert_redirect_cached (
899899 "/dummy/0.1.0/x86_64-unknown-linux-gnu/dummy/" ,
900900 base,
901- CachePolicy :: ForeverOnlyInCdn ,
901+ CachePolicy :: ForeverInCdn ,
902902 web,
903903 & env. config ( ) ,
904904 ) ?;
@@ -954,7 +954,7 @@ mod test {
954954 . create ( ) ?;
955955
956956 let resp = env. frontend ( ) . get ( "/dummy/latest/dummy/" ) . send ( ) ?;
957- assert_cache_control ( & resp, CachePolicy :: ForeverOnlyInCdn , & env. config ( ) ) ;
957+ assert_cache_control ( & resp, CachePolicy :: ForeverInCdn , & env. config ( ) ) ;
958958 assert ! ( resp. url( ) . as_str( ) . ends_with( "/dummy/latest/dummy/" ) ) ;
959959 let body = String :: from_utf8 ( resp. bytes ( ) . unwrap ( ) . to_vec ( ) ) . unwrap ( ) ;
960960 assert ! ( body. contains( "<a href=\" /crate/dummy/latest/source/\" " ) ) ;
@@ -982,7 +982,7 @@ mod test {
982982
983983 {
984984 let resp = web. get ( "/dummy/latest/dummy/" ) . send ( ) ?;
985- assert_cache_control ( & resp, CachePolicy :: ForeverOnlyInCdn , & env. config ( ) ) ;
985+ assert_cache_control ( & resp, CachePolicy :: ForeverInCdn , & env. config ( ) ) ;
986986 }
987987
988988 {
0 commit comments