Skip to content

Commit 4d78e03

Browse files
committed
fix rustdoc caching tests
1 parent 2db2d76 commit 4d78e03

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/web/rustdoc.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -912,14 +912,21 @@ mod test {
912912
.archive_storage(true)
913913
.rustdoc_file("dummy/index.html")
914914
.create()?;
915-
let resp = env.frontend().get("/dummy/latest/dummy/").send()?;
916-
assert_eq!(resp.headers().get("Cache-Control").unwrap(), &"max-age=0");
917915

918-
let resp = env.frontend().get("/dummy/0.1.0/dummy/").send()?;
919-
assert_eq!(
920-
resp.headers().get("Cache-Control").unwrap(),
921-
&"stale-while-revalidate=2592000, max-age=600"
922-
);
916+
let web = env.frontend();
917+
918+
{
919+
let resp = web.get("/dummy/latest/dummy/").send()?;
920+
assert_eq!(resp.headers().get("Cache-Control").unwrap(), &"max-age=0");
921+
}
922+
923+
{
924+
let resp = web.get("/dummy/0.1.0/dummy/").send()?;
925+
assert_eq!(
926+
resp.headers().get("Cache-Control").unwrap(),
927+
&"stale-while-revalidate=2592000, max-age=600"
928+
);
929+
}
923930
Ok(())
924931
})
925932
}

0 commit comments

Comments
 (0)