Skip to content

Commit

Permalink
Merge pull request #31 from fermyon/authority-equal-host
Browse files Browse the repository at this point in the history
Assert that the authority is equal to the host header
  • Loading branch information
rylev authored Aug 15, 2024
2 parents 387b7f3 + 2d13e77 commit ca70052
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/request-shape/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ fn check_url(req: &IncomingRequest) -> anyhow::Result<()> {
let authority = req
.authority()
.context("incoming request has no authority")?;
let _addr: std::net::SocketAddr = authority
.parse()
.context("authority is not a valid SocketAddr")?;
// The authority is equal to the original request's HOST header
assert_eq!(authority, "example.com");

let path_with_query = req.path_with_query();
let expected = "/base/path/end/rest?key=value";
Expand Down

0 comments on commit ca70052

Please sign in to comment.