-
Notifications
You must be signed in to change notification settings - Fork 41
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
Broken Link #13207
Comments
It looks like there should be an
@jawman1 This is on a mobile device, right? |
On mobile yes, sorry. Android: Galaxy S10
…On Wed, May 22, 2019 at 14:56 Jorge Villalobos ***@***.***> wrote:
It looks like there should be an / after android and before the params.
@muffinresearch <https://github.com/muffinresearch>, is this necessary
for the link to work?
I just installed firefox.
@jawman1 <https://github.com/jawman1> This is on a mobile device, right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13207?email_source=notifications&email_token=AMEG5CN5QKO4EE26KAUPTCTPWWXRTA5CNFSM4HOXFJFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWAKHZA#issuecomment-494969828>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMEG5CO5A6KLAPGNL7XOXJ3PWWXRTANCNFSM4HOXFJFA>
.
|
Some further information: The above-mentioned link is (has been) a default bookmark in all versions of Firefox for Android ("normal", beta and nightly). According to archive.is it had worked in the past. Interestingly, the link is a default bookmark even with a newly reinstalled nightly, and indeed it's present in the android source. Just in case, I've filed a bug on bugzilla. |
With a trailing slash, the prefix middleware builds a correct URL but without it, it redirects to |
This does seem like it's a case that should just work, though IIRC our entire URL scheme typically does have trailing slashes. |
I also noticed that |
I suspect if you add a test similar to that with a |
I added this test case to reproduce this bug, and it failed: it('should not mangle a query string for a redirect', () => {
const fakeReq = {
originalUrl: '/android?test=1&bar=2',
headers: {},
};
prefixMiddleware(fakeReq, fakeRes, fakeNext, { _config: fakeConfig });
sinon.assert.calledWith(
fakeRes.redirect,
301,
'/en-US/android/?test=1&bar=2',
);
}); ● /Users/williamdurand/projects/mozilla/addons-frontend/tests/unit/core/middleware/test_prefixMiddleware.js › should not mangle a query string for a redirect
|
I would imagine a fix for this would actually be for this url to not result in a redirect but to be passed straight-through as the slashes middleware should add the slash for it and that middleware follows this one. See also https://addons.mozilla.org/firefox?foo=1 which would have the same issue. |
How could we detect that? If URL contains |
I think the core of the problem is that the places checking for clientApp are including the query params because they're not split out independently. Redirection only occurs in the prefix middleware if the url is different https://github.com/mozilla/addons-frontend/blob/32c493bfc2290206df827bbee2c5b1b9ce8082a5/src/core/middleware/prefixMiddleware.js#L118 so if the resulting url is unchanged the slash middleware should just do its thing. |
Yep, I noticed that too. |
👌 |
Actually in these cases it would still be a redir because the locale would be added. But something like |
@ioanarusiczki I am not sure to follow, those links are for prod, but the fix has not been pushed to prod yet. |
@willdurand Sorry, I got confused thinking that links with utm parameters only have to deal with addons.mozilla (more complicated to explain why) . So I only described above the actual issue. https://addons-dev.allizom.org/android?utm_source=inproduct&utm_medium=default-bookmarks&utm_campaign=mobileandroid redirects correctly |
Describe the problem
I just installed firefox. I opened a new tab and moved to the bookmarks selection. I tapped the Firefox: customize with addons and it took me to a page that does not exist. This seems to be on the default home page.
What happened?
The page it directed me to seemed to be where maybe a soecific add-on had been. I dont know where it was supposed to take me.
What did you expect to happen?
Anything else we should know?
https://addons.mozilla.org/android?utm_source=inproduct&utm_medium=default-bookmarks&utm_campaign=mobileandroid
The text was updated successfully, but these errors were encountered: