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

* Issue #11911 Fix documentation example for Request.getHttpUri
This commit is contained in:
Jan Bartel 2024-06-14 11:18:31 +02:00 committed by GitHub
parent d34556749f
commit 619c539af3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,7 @@ import org.eclipse.jetty.http.HttpCookie;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.Trailers;
import org.eclipse.jetty.io.Content;
import org.eclipse.jetty.server.Context;
@ -60,10 +61,11 @@ public class ServletToHandlerDocs
// - servletRequest.getProtocol();
String protocol = request.getConnectionMetaData().getProtocol();
// Gets the full request URI.
// Gets the request URL.
// Replaces:
// - servletRequest.getRequestURL();
String fullRequestURI = request.getHttpURI().asString();
HttpURI httpURI = HttpURI.build(request.getHttpURI()).query(null);
StringBuffer requestURL = new StringBuffer(httpURI.asString());
// Gets the request context.
// Replaces: