-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
iroh-net does not send the Host:
header to the relay
#2870
Milestone
Comments
It seems this part of code missies iroh/iroh-net/src/relay/client.rs Lines 719 to 722 in f0590be
The value should be self.url.host_str() .
As described in https://docs.rs/hyper/1.5.0/hyper/header/constant.HOST.html "A Host header field must be sent in all HTTP/1.1 request messages. A 400 (Bad Request) status code will be sent to any HTTP/1.1 request message that lacks a Host header field or contains more than one.". |
Host:
header to the relay?Host:
header to the relay
2 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Nov 4, 2024
## Description Reverse proxies that map multiple virtual hosts need some help to know where to forward requests to. That's what the [`HOST` header](https://datatracker.ietf.org/doc/html/rfc2616#section-14.23) is for, and it's mandatory for HTTP/1.1 requests. Closes #2870 ## Change checklist - [x] Self-review. - ~~[ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant.~~ - [x] Tests if relevant. - ~~[ ] All breaking changes documented.~~
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I am trying to put iroh-relay behind nginx: chatmail/server#445
Current problem is that nginx rejects the requests from iroh-net 0.25.0 with error 400.
According to the logs nginx gets
GET /relay HTTP/1.1
, then headerupgrade: iroh derp http
, then rejects becauseclient sent HTTP/1.1 request without "Host" header
.I cannot make it proxy the request to iroh-relay.
HTTP/1.1 requires the
Host:
header and it seems to be impossible to make nginx proxy requests that don't have one.I will try to upgrade iroh-net and see if it resolves the problem. EDIT: upgraded to 0.26.0 so far, and the problem remained. Trying to upgrade to 0.27.0, but it has its own problems: deltachat/deltachat-core-rust#6133
The text was updated successfully, but these errors were encountered: