Skip to content

Add vanity /qr URL aliasing mobile_app redirector#792

Open
janbrasna wants to merge 6 commits into
mozmeao:mainfrom
janbrasna:add/qr-alias-redirect
Open

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

Conversation

@janbrasna

Copy link
Copy Markdown
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

@janbrasna janbrasna left a comment

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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?

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.61%. Comparing base (5a152ec) to head (e51382d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #792   +/-   ##
=======================================
  Coverage   87.61%   87.61%           
=======================================
  Files         156      156           
  Lines       10816    10816           
=======================================
  Hits         9476     9476           
  Misses       1340     1340           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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