fix: ignore_paths are now checked before we do any translation logic #241
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.
Purpose/goal of Pull Request (Issue #)
https://wovnio.atlassian.net/browse/ST-2310
The original problem is on our dashboard, the user gets redirected back to English even if they have selected Japanese. This is fixed by adding the
use_cookie_lang
feature. However, this created a new issue where it messes up widget XHR session auth. Those requests should not be redirected.I noticed a few related issues in this area
Comments
ignore_paths
should be checked before we do anything else. This is what every other backend doesignore_paths
should be literal and really means do nothing if the requestmatches it. This is consistent with other backends as well.
/ignored_path?wovn=en
should be ignored.To actually fix the problem, rather than require settingCan't do this because it violates CORS limitsignore_paths
for every known widget/live editor request (error prone when we add more) I added a check for requests forX-Wovn-Widget
header. We will ignore these requests automatically.