Skip to content

Add vanity /qr URL aliasing mobile_app redirector#792

Open
janbrasna wants to merge 5 commits intomozmeao:mainfrom
janbrasna:add/qr-alias-redirect
Open

Add vanity /qr URL aliasing mobile_app redirector#792
janbrasna wants to merge 5 commits intomozmeao:mainfrom
janbrasna:add/qr-alias-redirect

Conversation

@janbrasna
Copy link
Collaborator

One-line summary

The shorter the URL, the more readable the QR code gets. This adds some aliasing to be able to link shorter mobile_app redirector URLs.

Significant changes and points to review

Shorter params could also be used on the original endpoint, there's no restriction.

Tests were added to demonstrate mixing'n'matching the patterns between the approaches.

Issue / Bugzilla link

#765

Testing

pytest -k test_redirects.py
http://localhost:8000/qr
http://localhost:8000/qr?c=foo
http://localhost:8000/fy-NL/qr/?product=quux
http://localhost:8000/de-BE/browsers/mobile/app/?p=klar&campaign=qr-focus (will show store error outside germany unless using android ua)
http://localhost:8000/browsers/mobile/app/?product=focus&campaign=qr-focus (control)

@janbrasna janbrasna marked this pull request as ready for review November 19, 2025 10:44
@janbrasna janbrasna added the Needs Review Awaiting code review label Nov 19, 2025
Copy link
Collaborator Author

@janbrasna janbrasna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering where to document this endpoint alias best so it's not just tribal knowledge. Ideally in some code using it, but there's no consumer yet 😅 🤷

Comment on lines +37 to +38
product = request.GET.get("product") or request.GET.get("p")
campaign = request.GET.get("campaign") or request.GET.get("c")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmh, do we actually need to allowlist these somewhere? Was there a place that would list any permissible args?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant