Skip to content

Commit 89e246d

Browse files
Properly pass the HTTP version from the Jetty request to the NGRequest
1 parent 5f2f4dd commit 89e246d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ng-adaptor-jetty/src/main/java/ng/adaptor/jetty/NGAdaptorJetty.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,13 @@ private static NGRequest requestToNGRequest( final Request jettyRequest ) {
312312
throw new UncheckedIOException( "Failed to consume the HTTP request's inputstream", e );
313313
}
314314

315-
// FIXME: Get the protocol
316-
final NGRequest request = new NGRequest( jettyRequest.getMethod(), jettyRequest.getHttpURI().getCanonicalPath(), "FIXME", headerMap( jettyRequest ), bos.toByteArray() );
315+
final String method = jettyRequest.getMethod();
316+
final String uri = jettyRequest.getHttpURI().getCanonicalPath();
317+
final String httpVersion = jettyRequest.getConnectionMetaData().getHttpVersion().asString();
318+
final Map<String, List<String>> headers = headerMap( jettyRequest );
319+
final byte[] content = bos.toByteArray();
320+
321+
final NGRequest request = new NGRequest( method, uri, httpVersion, headers, content );
317322

318323
// FIXME: Form value parsing should really happen within the request object, not in the adaptor // Hugi 2021-12-31
319324
request._setFormValues( formValues );

0 commit comments

Comments
 (0)