mirror of
https://github.com/swift-server/async-http-client.git
synced 2026-05-03 07:32:29 +00:00
19e83a35df
### Motivation If we follow a redirect which changes the origin e.g. from `127.0.0.1` to `localhost` we didn't change the `Host` header to the appropriate new origin and port combination. ### Changes Use the original request which does not include the host instead of the prepared request to form a new request to the redirect URL. ### Alternatives If the user defines a `Host` header themselves on the original `HTTPClientRequest` we currently never touch it, even in the redirect case. Maybe we should change our strategy and do one of the following: 1. We could always override the user defined `Host` header 2. We could only remove the user defined `Host` header on redirect and set it to the new origin and port combination