Make sure the redirects doctest actually tests something for 301 redirects
This commit is contained in:
committed by
Martin Algesten
parent
4a3d3c49a1
commit
37f991fa50
@@ -28,6 +28,10 @@ pub(crate) fn test_agent() -> Agent {
|
|||||||
stream.write_all(b"HTTP/1.1 200 OK\r\n")?;
|
stream.write_all(b"HTTP/1.1 200 OK\r\n")?;
|
||||||
stream.write_all(b"\r\n")?;
|
stream.write_all(b"\r\n")?;
|
||||||
stream.write_all(br#"{"hello": "world"}"#)?;
|
stream.write_all(br#"{"hello": "world"}"#)?;
|
||||||
|
} else if headers.path() == "/status/301" {
|
||||||
|
stream.write_all(b"HTTP/1.1 301 Found\r\n")?;
|
||||||
|
stream.write_all(b"Location: /redirect/3\r\n")?;
|
||||||
|
stream.write_all(b"\r\n")?;
|
||||||
} else if headers.path() == "/status/307" {
|
} else if headers.path() == "/status/307" {
|
||||||
stream.write_all(b"HTTP/1.1 307 Found\r\n")?;
|
stream.write_all(b"HTTP/1.1 307 Found\r\n")?;
|
||||||
stream.write_all(b"Location: /redirect/3\r\n")?;
|
stream.write_all(b"Location: /redirect/3\r\n")?;
|
||||||
|
|||||||
Reference in New Issue
Block a user