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

Redirect /android?something to /android/?something #8117

Closed
wants to merge 1 commit into from

Conversation

willdurand
Copy link
Member

@willdurand willdurand commented Jun 3, 2019

Fixes mozilla/addons#13207


This fixes mozilla/addons#13207 by introducing a server redirect instead of trying to patch the prefix middleware. This also adds a framework to add other server redirects since it seems we do not want them in Nginx.

Adding a new redirect rule with this framework can be done by:

  1. adding a new entry to the SERVER_REDIRECTS map (with a short and meaningful key)
  2. adding an entry (or more) in the each() array of the test case

@codecov-io
Copy link

codecov-io commented Jun 3, 2019

Codecov Report

Merging #8117 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   mozilla/addons-frontend#8117      +/-   ##
=========================================
+ Coverage   98.09%   98.1%   +<.01%     
=========================================
  Files         260     260              
  Lines        7363    7373      +10     
  Branches     1331    1332       +1     
=========================================
+ Hits         7223    7233      +10     
  Misses        126     126              
  Partials       14      14
Impacted Files Coverage Δ
src/core/server/base.js 65.5% <100%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bc13ad...2b85136. Read the comment docs.

@muffinresearch
Copy link
Contributor

I think this should be fixed in the prefix middleware rather than introduce yet another place for redirects.

@willdurand
Copy link
Member Author

willdurand commented Jun 3, 2019

I think this should be fixed in the prefix middleware rather than introduce yet another place for redirects.

That makes sense, although I was not able to fix it today.. I'll give it another try. This patch is needed anyway (without the android redirect) because we want to add new redirects in the very near future (and likely move some permanent redirects from nginx to this codebase)

@bobsilverberg
Copy link
Contributor

I've seen the discussion in the issue and it sounds like I should hold off reviewing this as possibly the approach is going to change?

@willdurand
Copy link
Member Author

I've seen the discussion in the issue and it sounds like I should hold off reviewing this as possibly the approach is going to change?

The approach to fix mozilla/addons#13207, yes. You can probably reuse this patch for #8105 though :)

@muffinresearch
Copy link
Contributor

muffinresearch commented Jun 3, 2019

I think this should be fixed in the prefix middleware rather than introduce yet another place for redirects.

That makes sense, although I was not able to fix it today.. I'll give it another try. This patch is needed anyway (without the android redirect) because we want to add new redirects in the very near future (and likely move some permanent redirects from nginx to this codebase)

@willdurand In case it helps, I've proposed an independent prefix middleware patch to fix mozilla/addons#13207 over here: #8120

@willdurand willdurand closed this Jun 4, 2019
@willdurand willdurand deleted the redirect-android branch June 4, 2019 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken Link
4 participants