Skip to content

Fix redirect loop bug in ResourceFileServlet - #333

Merged
copybara-service[bot] merged 1 commit into
mainfrom
ee8-ResourceFileServlet-RedirectLoop
Jan 24, 2025
Merged

Fix redirect loop bug in ResourceFileServlet#333
copybara-service[bot] merged 1 commit into
mainfrom
ee8-ResourceFileServlet-RedirectLoop

Conversation

@lachlan-roberts

Copy link
Copy Markdown
Collaborator

I ran into a bug in ResourceFileServlet, where trying to access a static file puts you in a redirect loop resulting in a URI looking like this:

http://localhost:8080/hello.txt/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/

The call to getHolderEntry("/") was finding the context root mapping instead of the default mapping, this was causing an infinite redirect bug. This PR changes this to use getServletMapping("/") which tests by pathSpec.

Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@ghost

ghost commented Jan 24, 2025

Copy link
Copy Markdown

Gemini encountered an error creating the summary. You can try again by commenting @code-review-assist summarize.

@copybara-service
copybara-service Bot merged commit afe26bc into main Jan 24, 2025
@copybara-service
copybara-service Bot deleted the ee8-ResourceFileServlet-RedirectLoop branch January 24, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants