-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrectly computes HTTP/2 client origin set #35356
Comments
I would be interested on helping with this |
Hi, So what I am seeing is I believe this is the file that needs to be edited: lib/internal/http2/core.js function initOriginSet(session) { I am wondering if I should just remove the port from being included? I am thinking that maybe making it optional makes more sense. Does anyone have some guidance how best to resolve this one? |
@szmarczak after looking at this more I see how this is expected use from what I can tell. I believe this is to allow origin witin this spec https://tools.ietf.org/html/rfc7230#section-2.3. Which it looks like it was implemented with this PR #17935. @jasnell can you confirm if this is correct I believe you would know for sure. |
I don't think the RFC applies here - the point of that option is to allow you to send an Origin frame that does not conform to what the RFC specifies from Node's point of view - most probably because of some special routing or tunneling or proxying or whatever. |
@szmarczak , I think that the server correctly sends to the client the origin you requested, but keeps an internal originSet with all values. Whether this is correct is surely debatable, but it does not really have an impact on the outside world. |
That's why I used the word |
In fact, it is the server session that exhibits this debatable behavior. In your code you are referring to the client session originSet which is correct in that particular case according to https://tools.ietf.org/html/draft-ietf-httpbis-origin-frame-06#section-2.3 Is this what you meant? |
If that's the case then it's still a bug since I connected to |
The RFC states that the client should initialize the originSet with the same host name that was used for the SNI for the TLS handshake if there was a SNI, otherwise it should use the DNS name or the IP address of the host it connected to. Once again, it is a debatable edge case - I don't think the code implements this to the letter - I think it will use the URL hostname even if there was not an SNI - but this case is so obscure I don't think it qualifies for a PR 😄 |
This still doesn't change the fact that it's a bug in Node.js. I see no reason why it's debatable. |
Actually someone may think that the current state is a desired one, therefore I'm closing. I decided to internally check if there is a mismatch between the origin and the actual remote target. |
Linux solus 5.6.19-158.current #1 SMP PREEMPT Sun Jul 26 14:17:01 UTC 2020 x86_64 GNU/Linux
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
or throw if there's a mismatch between
origin.port
andoptions.port
?What do you see instead?
The text was updated successfully, but these errors were encountered: