Skip to content

Commit 27865d2

Browse files
committed
Fixed NPE introduced by #10618.
Signed-off-by: Simone Bordet <[email protected]>
1 parent 0981c22 commit 27865d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpChannelState.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,12 +616,12 @@ public void run()
616616

617617
try
618618
{
619-
if (!Request.getPathInContext(_request).startsWith("/") &&
620-
!HttpMethod.PRI.is(request.getMethod()) &&
621-
!HttpMethod.CONNECT.is(request.getMethod()) &&
622-
!HttpMethod.OPTIONS.is(request.getMethod()))
619+
String pathInContext = Request.getPathInContext(request);
620+
if (pathInContext != null && !pathInContext.startsWith("/"))
623621
{
624-
throw new BadMessageException("Bad URI path");
622+
String method = request.getMethod();
623+
if (!HttpMethod.PRI.is(method) && !HttpMethod.CONNECT.is(method) && !HttpMethod.OPTIONS.is(method))
624+
throw new BadMessageException("Bad URI path");
625625
}
626626

627627
HttpURI uri = request.getHttpURI();

0 commit comments

Comments
 (0)