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

Fix #10306 getServerHost #10311

Merged
merged 7 commits into from
Aug 18, 2023
Merged

Fix #10306 getServerHost #10311

merged 7 commits into from
Aug 18, 2023

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Aug 14, 2023

Fix #10306 getServerHost

Use the default scheme before using the local port

Fix #10306 getServerHost
@gregw gregw linked an issue Aug 14, 2023 that may be closed by this pull request
@gregw gregw marked this pull request as ready for review August 16, 2023 02:00
@gregw
Copy link
Contributor Author

gregw commented Aug 16, 2023

@sbordet @joakime The CI failure is a flake. This is ready for review.

@gregw gregw requested a review from sbordet August 16, 2023 02:01
@gregw
Copy link
Contributor Author

gregw commented Aug 16, 2023

@sbordet nudge

@gregw gregw requested a review from joakime August 16, 2023 20:53
@gregw gregw requested a review from sbordet August 17, 2023 13:41
sbordet
sbordet previously approved these changes Aug 17, 2023
@@ -419,23 +418,18 @@ static String getServerName(Request request)
if (uri.hasAuthority())
return HostPort.normalizeHost(uri.getHost());

HostPort authority = request.getConnectionMetaData().getHttpConfiguration().getServerAuthority();
HostPort authority = request.getConnectionMetaData().getServerAuthority();
if (authority != null)
return HostPort.normalizeHost(authority.getHost());
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to normalize again, as HostPort normalizes in the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sbordet Fixed, but will need a re-review to get green tick back

@gregw gregw merged commit 042841a into jetty-12.0.x Aug 18, 2023
2 checks passed
@gregw gregw deleted the fix/10306/host-header branch August 18, 2023 00:11
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.

Jetty 12 generates wrong Host header
2 participants