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
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,12 @@ public boolean handle(Request request, Response response, Callback callback) thr

protected boolean handleByContextHandler(String pathInContext, ContextRequest request, Response response, Callback callback)
{
if (isProtectedTarget(pathInContext))
{
Response.writeError(request, response, callback, HttpStatus.NOT_FOUND_404, null);
return true;
}

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

@Override
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading