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

Jetty 12 - Simplification of aliases in PathResource (Take 2) #8734

Merged
merged 22 commits into from
Oct 19, 2022

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Oct 18, 2022

This is an update of PR #8631 to address the PathResource alias checking when it comes to bad resources.

PathResource cleanup

  • Adding comments about class fields.
  • Removing normalization from input/output/comparison flows.
  • Collapsing resolveTargetPath into resolveAlias to react accordingly to the exceptions that can flow out of Path.toRealPath().
  • Failure on Path.toRealPath() is never an alias, as the resource cannot ever be served anyway.
  • More comments in resolveAlias()
  • Failed / Bad / Nonexistent / Inaccessible resources are not aliases to anything.

The changes in PR #8702 would impact these changes as we would never even have a Resource that is Failed / Bad / Nonexistent / Inaccessible resources anyway, rendering the extra checks in the resolveAlias() flows irrelevant for these kinds of bad resources (they are still relevant for good / accessible resources).

lachlan-roberts and others added 17 commits September 28, 2022 15:09
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
+ Adding comments about class fields.
+ Removing normalization from
  input/output/comparison flows.
+ Collapsing `resolveTargetPath`
  into `resolveAlias` to react
  accordingly to the exceptions
  that can flow out of Path.toRealPath().
+ Failure on Path.toRealPath() is never
  an alias, as the resource cannot ever
  be served anyway.
+ More comments in `resolveAlias()`
+ Failed / Bad / Nonexistent / Inaccessible
  resources are not aliases to anything.
@joakime joakime self-assigned this Oct 18, 2022
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

Is this replacing @lachlan-roberts's #8631 ? Oh I see the description says that. OK then...

a couple of niggles....

@joakime joakime requested a review from gregw October 18, 2022 23:16
@joakime joakime merged commit 9061348 into jetty-12.0.x Oct 19, 2022
@joakime joakime deleted the fix/jetty-12-PathResource-simpler-alias branch October 19, 2022 16:17
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.

3 participants