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

Issue #11911 Fix documentation example for Request.getHttpUri #11916

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

janbartel
Copy link
Contributor

Closes #11911

Migration documentation implies that Request.getHttpURI() is the jetty-12 substitute for Request.getRequestURL() in prior versions, which is not strictly true. Clarified the code example.

@janbartel janbartel requested a review from gregw June 13, 2024 02:28
@janbartel janbartel self-assigned this Jun 13, 2024
// Replaces:
// - servletRequest.getRequestURL();
String fullRequestURI = request.getHttpURI().asString();
StringBuffer requestURL = new StringBuffer(HttpURI.build(request.getHttpURI()).query(null).asString());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think splitting makes it more clear what is the Jetty API, and what is boilerplate:

Suggested change
StringBuffer requestURL = new StringBuffer(HttpURI.build(request.getHttpURI()).query(null).asString());
HttpURI uri = HttpURI.build(request.getHttpURI()).query(null);
StringBuffer requestURL = new StringBuffer(uri.asString());

@janbartel janbartel requested a review from sbordet June 14, 2024 00:04
@janbartel janbartel merged commit 619c539 into jetty-12.0.x Jun 14, 2024
10 checks passed
@janbartel janbartel deleted the jetty-12.0.x-11911-doc-getHttpURI branch June 14, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
2 participants