-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[FW][FIX] *: use request.redirect instead of werkzeug.utils.redirect #94608
Closed
fw-bot
wants to merge
1
commit into
odoo:saas-15.1
from
odoo-dev:saas-15.1-15.0-req-redirect-jke-KaGb-fw
Closed
[FW][FIX] *: use request.redirect instead of werkzeug.utils.redirect #94608
fw-bot
wants to merge
1
commit into
odoo:saas-15.1
from
odoo-dev:saas-15.1-15.0-req-redirect-jke-KaGb-fw
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
It allows to always have a OdooResponse Object and don't allow redirect to external except when you allow it explicitly with local=False. Always return to a local url: /website/add /slides/slide/<model("slide.slide"):slide> /microsoft_outlook/confirm Allow previously external redirect without reason, now blocked /website/lang/<lang> -> open redirect Allow external redirect for good reason and url is controlled by code. /social_facebook/redirect_to_profile/ PS: HTTP Code 303 is a better default for generic redirects. It's not historically the default for werkzeug.utils, but it is what we want in general. Contrary to 302, there is no browser-dependent behavior, and no risk of asking the user whether they want to accept the redirect if the original method wasn't GET. It's always a non-permanent GET on the target location. X-original-commit: f4cfa22
This PR targets saas-15.1 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
robodoo
pushed a commit
that referenced
this pull request
Jun 29, 2022
It allows to always have a OdooResponse Object and don't allow redirect to external except when you allow it explicitly with local=False. Always return to a local url: /website/add /slides/slide/<model("slide.slide"):slide> /microsoft_outlook/confirm Allow previously external redirect without reason, now blocked /website/lang/<lang> -> open redirect Allow external redirect for good reason and url is controlled by code. /social_facebook/redirect_to_profile/ PS: HTTP Code 303 is a better default for generic redirects. It's not historically the default for werkzeug.utils, but it is what we want in general. Contrary to 302, there is no browser-dependent behavior, and no risk of asking the user whether they want to accept the redirect if the original method wasn't GET. It's always a non-permanent GET on the target location. closes #94608 X-original-commit: f4cfa22 Related: odoo/enterprise#28874 Signed-off-by: Olivier Dony <odo@odoo.com> Signed-off-by: Jérémy Kersten <jke@odoo.com>
Linked pull request(s) odoo/enterprise#28874 not ready. Linked PRs are not staged until all of them are ready. |
robodoo
pushed a commit
that referenced
this pull request
Jul 1, 2022
It allows to always have a OdooResponse Object and don't allow redirect to external except when you allow it explicitly with local=False. Always return to a local url: /website/add /slides/slide/<model("slide.slide"):slide> /microsoft_outlook/confirm Allow previously external redirect without reason, now blocked /website/lang/<lang> -> open redirect Allow external redirect for good reason and url is controlled by code. /social_facebook/redirect_to_profile/ PS: HTTP Code 303 is a better default for generic redirects. It's not historically the default for werkzeug.utils, but it is what we want in general. Contrary to 302, there is no browser-dependent behavior, and no risk of asking the user whether they want to accept the redirect if the original method wasn't GET. It's always a non-permanent GET on the target location. closes #94608 X-original-commit: f4cfa22 Related: odoo/enterprise#28874 Signed-off-by: Olivier Dony <odo@odoo.com> Signed-off-by: Jérémy Kersten <jke@odoo.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
It allows to always have a OdooResponse Object and don't allow redirect
to external except when you allow it explicitly with local=False.
Always return to a local url:
/website/add
/slides/slide/<model("slide.slide"):slide>
/microsoft_outlook/confirm
Allow previously external redirect without reason, now blocked
/website/lang/ -> open redirect
Allow external redirect for good reason and url is controlled by code.
/social_facebook/redirect_to_profile/
PS: HTTP Code 303 is a better default for generic redirects. It's not historically the default for werkzeug.utils, but it is what we want in general. Contrary to 302, there is no browser-dependent behavior, and no risk of asking the user whether they want to accept the redirect if the original method wasn't GET. It's always a non-permanent GET on the target location.
Forward-Port-Of: #93929