@@ -67,7 +67,7 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult<Response> {
67
67
68
68
let mut resp = Response :: with ( ( status:: Found , Redirect ( url) ) ) ;
69
69
resp. extensions
70
- . insert :: < CachePolicy > ( CachePolicy :: ForeverOnlyInCdn ) ;
70
+ . insert :: < CachePolicy > ( CachePolicy :: ForeverInCdn ) ;
71
71
Ok ( resp)
72
72
}
73
73
@@ -190,7 +190,7 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult<Response> {
190
190
} ;
191
191
192
192
let cache = if version == "latest" {
193
- CachePolicy :: ForeverOnlyInCdn
193
+ CachePolicy :: ForeverInCdn
194
194
} else {
195
195
CachePolicy :: ForeverInCdnAndStaleInBrowser
196
196
} ;
@@ -263,7 +263,7 @@ impl RustdocPage {
263
263
let mut response = Response :: with ( ( Status :: Ok , html) ) ;
264
264
response. headers . set ( ContentType :: html ( ) ) ;
265
265
response. extensions . insert :: < CachePolicy > ( if is_latest_url {
266
- CachePolicy :: ForeverOnlyInCdn
266
+ CachePolicy :: ForeverInCdn
267
267
} else {
268
268
CachePolicy :: ForeverInCdnAndStaleInBrowser
269
269
} ) ;
@@ -356,7 +356,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
356
356
// to prevent cloudfront caching the wrong artifacts on URLs with loose semver
357
357
// versions, redirect the browser to the returned version instead of loading it
358
358
// immediately
359
- return redirect ( & name, & v, & req_path, CachePolicy :: ForeverOnlyInCdn ) ;
359
+ return redirect ( & name, & v, & req_path, CachePolicy :: ForeverInCdn ) ;
360
360
}
361
361
} ;
362
362
@@ -387,7 +387,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
387
387
& name,
388
388
& version_or_latest,
389
389
& req_path[ 1 ..] ,
390
- CachePolicy :: ForeverOnlyInCdn ,
390
+ CachePolicy :: ForeverInCdn ,
391
391
) ;
392
392
}
393
393
@@ -427,7 +427,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
427
427
& name,
428
428
& version_or_latest,
429
429
& req_path,
430
- CachePolicy :: ForeverOnlyInCdn ,
430
+ CachePolicy :: ForeverInCdn ,
431
431
)
432
432
} else if req_path. first ( ) . map_or ( false , |p| p. contains ( '-' ) ) {
433
433
// 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> {
436
436
& format ! ( "/crate/{}" , name) ,
437
437
& format ! ( "{}/target-redirect" , version) ,
438
438
& req_path,
439
- CachePolicy :: ForeverOnlyInCdn ,
439
+ CachePolicy :: ForeverInCdn ,
440
440
)
441
441
} else {
442
442
Err ( Nope :: ResourceNotFound . into ( ) )
@@ -456,7 +456,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
456
456
// which means we cache slightly different for `/latest/` and
457
457
// URLs with versions.
458
458
response. extensions . insert :: < CachePolicy > ( if is_latest_url {
459
- CachePolicy :: ForeverOnlyInCdn
459
+ CachePolicy :: ForeverInCdn
460
460
} else {
461
461
CachePolicy :: ForeverInCdnAndStaleInBrowser
462
462
} ) ;
@@ -701,7 +701,7 @@ pub fn target_redirect_handler(req: &mut Request) -> IronResult<Response> {
701
701
let url = ctry ! ( req, Url :: parse( & url) ) ;
702
702
let mut resp = Response :: with ( ( status:: Found , Redirect ( url) ) ) ;
703
703
resp. extensions . insert :: < CachePolicy > ( if is_latest_url {
704
- CachePolicy :: ForeverOnlyInCdn
704
+ CachePolicy :: ForeverInCdn
705
705
} else {
706
706
CachePolicy :: ForeverInCdnAndStaleInBrowser
707
707
} ) ;
@@ -788,7 +788,7 @@ mod test {
788
788
. next ( )
789
789
{
790
790
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) ?;
792
792
Ok ( Some ( link) )
793
793
} else {
794
794
Ok ( None )
@@ -898,7 +898,7 @@ mod test {
898
898
assert_redirect_cached (
899
899
"/dummy/0.1.0/x86_64-unknown-linux-gnu/dummy/" ,
900
900
base,
901
- CachePolicy :: ForeverOnlyInCdn ,
901
+ CachePolicy :: ForeverInCdn ,
902
902
web,
903
903
& env. config ( ) ,
904
904
) ?;
@@ -954,7 +954,7 @@ mod test {
954
954
. create ( ) ?;
955
955
956
956
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 ( ) ) ;
958
958
assert ! ( resp. url( ) . as_str( ) . ends_with( "/dummy/latest/dummy/" ) ) ;
959
959
let body = String :: from_utf8 ( resp. bytes ( ) . unwrap ( ) . to_vec ( ) ) . unwrap ( ) ;
960
960
assert ! ( body. contains( "<a href=\" /crate/dummy/latest/source/\" " ) ) ;
@@ -982,7 +982,7 @@ mod test {
982
982
983
983
{
984
984
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 ( ) ) ;
986
986
}
987
987
988
988
{
0 commit comments