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

This fixes an issue where Zuul does not correctly handle absolute URIs from Netty #1180

Merged
merged 2 commits into from
Jan 27, 2022

Conversation

artgon
Copy link
Contributor

@artgon artgon commented Jan 26, 2022

As per https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 the path segment of an inbound request can have an absolute URI in it. This fixes an issue where Zuul assumes that it's always a relative URI.

@artgon artgon requested review from mridgway, argha-c and kyagna January 26, 2022 01:21
Copy link
Contributor

@kyagna kyagna left a comment

Choose a reason for hiding this comment

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

LGTM

// absolute uri
if (m.matches()) {
String match = m.group(3);
path = match == null ? uri : match;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't read great. Consider making the assignment explicit on each branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


// absolute uri
if (m.matches()) {
String match = m.group(3);
Copy link
Collaborator

@argha-c argha-c Jan 26, 2022

Choose a reason for hiding this comment

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

Consider adding an example URI in the comment. 3 reads like a magic number otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment at the top.

@artgon artgon merged commit 52eba13 into master Jan 27, 2022
@artgon artgon deleted the absolute-uri branch January 27, 2022 17:24
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.

4 participants