Skip to content

request getPathInfo returns null #4577

@liudonghua123

Description

@liudonghua123

Jetty version
9.4.26.v20200117

Java version
1.8.0_191

OS type/version
Windows 10 1909

Description
I use IPAccessHandler for restricting ip and url access. My config file is something like belows.

<?xml version="1.0"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<!-- =============================================================== --><!-- Configure the test-jaas webapp                                  --><!-- =============================================================== -->
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">

  <Set name="contextPath">/auditlog</Set>
  <Set name="resourceBase">/d:/log/</Set>
  
  <Call name="insertHandler">
    <Arg>
      <New class="org.eclipse.jetty.server.handler.IPAccessHandler">
        <Call name="addWhite">
          <Arg>127.0.0.1|/*</Arg>
        </Call>
      </New>
    </Arg>
  </Call>

</Configure>

But when I browser http://127.0.0.1:8080/auditlog/, it always give me 403 error. After go through the code, I find it was baseRequest.getPathInfo() returned null instead of /auditlog/, so the validator logic failed.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions