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

Issue #11434 - resolve differences in AliasCheckerSymlinkTests #12208

Merged

Conversation

lachlan-roberts
Copy link
Contributor

closes #11434

Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@lachlan-roberts lachlan-roberts requested a review from gregw August 28, 2024 22:36
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@@ -0,0 +1 @@
This is in the second WEB-INF dir.
Copy link
Contributor

Choose a reason for hiding this comment

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

EOLN

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is intentional so we don't have to check for newline in the response for the test.

@@ -0,0 +1 @@
This is a file in the combined resource dir.
Copy link
Contributor

Choose a reason for hiding this comment

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

EOLN

@@ -0,0 +1 @@
file1 from combined dir
Copy link
Contributor

Choose a reason for hiding this comment

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

EOLN

@@ -0,0 +1 @@
file1 from webroot
Copy link
Contributor

Choose a reason for hiding this comment

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

EOLN

@@ -1197,7 +1197,7 @@ protected boolean handleByContextHandler(String pathInContext, ContextRequest re
return true;
}

return super.handleByContextHandler(pathInContext, request, response, callback);
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this always false return.

I think this method would be better written like:

    protected boolean handleByContextHandler(String pathInContext, ContextRequest request, Response response, Callback callback)
    {
        if (!request.instanceof ServletContextRequest && isProtectedTarget(pathInContext))
            return false;
        return super.handleByContextHandler(pathInContext, request, response, callback);
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you mean, but this code is incorrect with isProtectedTarget(pathInContext) here.

I think this is correct:

boolean initialDispatch = request instanceof ServletContextRequest;
if (!initialDispatch)
    return false;
return super.handleByContextHandler(pathInContext, request, response, callback);

Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@lachlan-roberts lachlan-roberts merged commit 899c005 into jetty-12.0.x Sep 3, 2024
10 checks passed
@lachlan-roberts lachlan-roberts deleted the jetty-12.0.x-11434-AliasCheckerSymlinkTests branch September 3, 2024 00:03
lachlan-roberts added a commit that referenced this pull request Sep 5, 2024
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@olamy olamy mentioned this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

resolve differences in EE9/EE10/Core AliasCheckerSymlinkTests
2 participants