Skip to content

Commit

Permalink
Make sure the redirects doctest actually tests something for 301 re…
Browse files Browse the repository at this point in the history
…directs
  • Loading branch information
jyn514 authored and algesten committed Dec 5, 2020
1 parent 4a3d3c4 commit 37f991f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/testserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"\r\n")?;
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" {
stream.write_all(b"HTTP/1.1 307 Found\r\n")?;
stream.write_all(b"Location: /redirect/3\r\n")?;
Expand Down

0 comments on commit 37f991f

Please sign in to comment.