Skip to content
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

Include port in authority computed from absolute-uri #1484

Merged
merged 2 commits into from
Aug 22, 2017

Conversation

mattwoodyard
Copy link
Contributor

Fix the misuse of the UF_* bitfields correctly.

Fix the misuse of the UF_* bitfields correctly.
@mattklein123
Copy link
Member

@alyssawilk you mind reviewing?

Buffer::OwnedImpl buffer(
"GET http://www.somewhere.com:4532/foo/bar HTTP/1.1\r\nHost: bah\r\n\r\n");
expectHeadersTest(Protocol::Http11, true, buffer, expected_headers);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One early suggestion, can you add an integration test with a port as well? I assume we'd want route config with host "www.foo.com" to match "www.foo.com:80" and I'm not confident this would work end-to-end

I think you can just tweak the config you added in your prior patch to not have a * domain and then add or copy-and-extend your current absolute-uri test to make sure we match correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though looking more at the code, if that doesn't work end to end it's more likely a problem with exiting route picking than this particular PR. So I'd still encourage testing and either fixing here or in a follow-up since ports are much more common with absolute URIs and this fix won't do much for you if you can't pick routes :-)

My only other comment is it'd be nice to have regression tests for the bit-shifting fix if it's doable But the code here looks totally solid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add the integration test and see what happens.

 - Test the difference in behavior with port
   numbers included in the uri and not
@mattklein123
Copy link
Member

@alyssawilk your question is somewhat but not entirely related to #886. I honestly don't have a super strong opinion on this. On one hand I think it's simpler to just strip port like you mentioned. On the other hand perhaps people want to do this? Will defer to you on what you think is best (I've honestly never encountered a production use case where this has mattered for me personally either way).

@mattwoodyard
Copy link
Contributor Author

I think the question of how mapping http://www.foo.com:80 -> http://www.foo.com is somewhat unrelated, but useful to plan for. Current absolute uri support doesn't allow clients to reach more than one port per hostname unless the configuration also uses prefix.

@alyssawilk
Copy link
Contributor

alyssawilk commented Aug 22, 2017 via email

@mattklein123
Copy link
Member

If I'm reading #886 <#886> if we strip
ports that would address that problem since http://host and http://host:80
will behave the same way, right?

I think partially it would help, but that person seems to want us to rewrite with 443 in the port. I'm not sure that I would want to do that at all. To me just stripping ports (at least optionally) seems like a better option.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @alyssawilk OK with you for now?

@alyssawilk
Copy link
Contributor

alyssawilk commented Aug 22, 2017 via email

@mattklein123 mattklein123 merged commit 7899547 into envoyproxy:master Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants