-
Notifications
You must be signed in to change notification settings - Fork 23k
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] base: serve_fallback infinite redirection #154883
Closed
Julien00859
wants to merge
1
commit into
odoo:16.0
from
odoo-dev:16.0-base-web_image_static_path_404-juc
Closed
[FIX] base: serve_fallback infinite redirection #154883
Julien00859
wants to merge
1
commit into
odoo:16.0
from
odoo-dev:16.0-base-web_image_static_path_404-juc
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create an attachment with an URL to a static file that does not exists, e.g. '/web/static/idontexist.png'. Inside your browser try to access that file, open <localhost:8069/web/static/idontexist.png>. The browser fails with a "Too Many Redirections" error. When a path is not found, nor in the static files, nor in the controllers, `_serve_fallback` kicks in and attempt to find a resource outside of the router that matches the URL. In case it finds an attachment with a matching URL, it'll deliver it. In this specific case, it finds our attachment and return a redirection to it's URL, which is the same URL as the request hence it loops back. Don't deliver URL attachments via `_serve_fallback`, only deliver stored files.
C3POdoo
requested review from
a team,
xmo-odoo and
ryv-odoo
and removed request for
a team
February 21, 2024 13:28
sleepy-monax
approved these changes
Feb 22, 2024
LGTM 👍 |
@robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
Mar 4, 2024
Create an attachment with an URL to a static file that does not exists, e.g. '/web/static/idontexist.png'. Inside your browser try to access that file, open <localhost:8069/web/static/idontexist.png>. The browser fails with a "Too Many Redirections" error. When a path is not found, nor in the static files, nor in the controllers, `_serve_fallback` kicks in and attempt to find a resource outside of the router that matches the URL. In case it finds an attachment with a matching URL, it'll deliver it. In this specific case, it finds our attachment and return a redirection to it's URL, which is the same URL as the request hence it loops back. Don't deliver URL attachments via `_serve_fallback`, only deliver stored files. closes #154883 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
This was referenced Mar 4, 2024
gamarino
pushed a commit
to numaes/numa-public-odoo
that referenced
this pull request
Mar 9, 2024
Create an attachment with an URL to a static file that does not exists, e.g. '/web/static/idontexist.png'. Inside your browser try to access that file, open <localhost:8069/web/static/idontexist.png>. The browser fails with a "Too Many Redirections" error. When a path is not found, nor in the static files, nor in the controllers, `_serve_fallback` kicks in and attempt to find a resource outside of the router that matches the URL. In case it finds an attachment with a matching URL, it'll deliver it. In this specific case, it finds our attachment and return a redirection to it's URL, which is the same URL as the request hence it loops back. Don't deliver URL attachments via `_serve_fallback`, only deliver stored files. closes odoo/odoo#154883 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create an attachment with an URL to a static file that does not exists, e.g. '/web/static/idontexist.png'. Inside your browser try to access that file, open localhost:8069/web/static/idontexist.png. The browser fails with a "Too Many Redirections" error.
When a path is not found, nor in the static files, nor in the controllers,
_serve_fallback
kicks in and attempt to find a resource outside of the router that matches the URL. In case it finds an attachment with a matching URL, it'll deliver it.In this specific case, it finds our attachment and return a redirection to it's URL, which is the same URL as the request hence it loops back.
Don't deliver URL attachments via
_serve_fallback
, only deliver stored files.Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr