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

Fix #7918 Root path spec #7919

Merged
merged 2 commits into from
Apr 26, 2022
Merged

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Apr 26, 2022

Handle root pathspec in PathMappings.asPathSpec

Not used in jetty-9, but will be ported forward to where it is used in 10,11 & 12

Signed-off-by: Greg Wilkins [email protected]

Handle root pathspec in PathMappings.asPathSpec

Signed-off-by: Greg Wilkins <[email protected]>
@gregw gregw requested review from joakime and lorban April 26, 2022 08:30
@Test
public void testAsPathSpec()
{
assertThat(PathMappings.asPathSpec(""), instanceOf(ServletPathSpec.class));
Copy link
Contributor

Choose a reason for hiding this comment

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

What about asPathSpec(null), should that be interpreted as ROOT too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is very precisely the empty string that matches "/" (and "/" matches everything - go figure!)

cleaner logic

Signed-off-by: Greg Wilkins <[email protected]>
@gregw gregw requested a review from joakime April 26, 2022 12:16
@gregw gregw linked an issue Apr 26, 2022 that may be closed by this pull request
@joakime joakime merged commit 6945f53 into jetty-9.4.x Apr 26, 2022
@joakime joakime deleted the jetty-9.4.x-7918-root-pathspec branch April 26, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PathMappings.asPathSpec does not allow root ServletPathSpec
3 participants