Closed Bug 1065006 Opened 7 years ago Closed 7 years ago

in-app product APIs cause 404s because of misinterpreted app origins

Categories

(Marketplace Graveyard :: Payments/Refunds, defect, P1)

Avenir
x86
macOS
defect

Tracking

(Not tracked)

VERIFIED FIXED
2014-09-16

People

(Reporter: kumar, Assigned: kumar)

References

Details

See bug 1064690 for STR

When the dev hub makes an API request it does so like this:
https://marketplace.allizom.org/api/v1/payments/app%3A//fxpay.allizom.org/in-app/
which works locally on Django's runserver but not on our nginx web servers. Maybe it's the double slash, who knows.

Anyway, the origin is technically not encoded right. If you do it from JavaScript (which the fxpay lib does, the encoding looks like:
https://marketplace.allizom.org/api/v1/payments/app%3A%2F%2Ffxpay.allizom.org/in-app/

This seems to be a bug in Django's reverse: https://github.com/mozilla/zamboni/blob/master/mkt/developers/templates/developers/payments/in-app-products.html#L54
but needs more investigation.
Blocks: 944480
Priority: -- → P1
more info:

>>> from django.core.urlresolvers import reverse
>>> reverse('in-app-products-list', args=['app://fxpay.allizom.org'])
'/api/v1/payments/app%3A//fxpay.allizom.org/in-app/'
Assignee: nobody → kumar.mcmillan
I've proposed a patch for review: https://github.com/mozilla/zamboni/pull/2527
fixed in the patch above. This will go on stage Wednesday at 12pm PST. We can push it sooner if you need it.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2014-09-16
Hmm, this patch works locally but not on our servers :(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
something is weird on the server. I filed bug 1065742
Depends on: 1065742
The nginx fix from bug 1065742 has been applied to dev, stage, and pay-alt. It is in deploy notes for next push.
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
This is now verified and fixed! Thanks !
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.