Deploy onyx 1.4.14 to production

VERIFIED FIXED

Status

VERIFIED FIXED
3 years ago
3 years ago

People

(Reporter: kthiessen, Assigned: relud)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
+++ This bug was initially created as a clone of Bug #1183120 +++

This release of onyx adds CORS support for API endpoints. More context in bug 1182602.

An easy way to test this is to do:

> $ curl -I -H "Origin: mozilla.org" http://127.0.0.1:5000/v3/links/fetch/en-US/nightly
> HTTP/1.1 303 SEE OTHER
> Server: gunicorn/18.0
> Date: Mon, 13 Jul 2015 14:46:48 GMT
> Connection: keep-alive
> Content-Type: text/html; charset=utf-8
> Content-Length: 0
> Location: https://tiles.cdn.mozilla.net/desktop-prerelease/STAR/en-US.5ab13754ce03fd4acbe6b137e2914b926104f900.ag.json
> Access-Control-Allow-Origin: mozilla.org

The important bits are:

1. the 'origin' header needs to be specified on an outbound request
2. the request yields and expected response (in this case a 303)
3. the server adds an 'Access-Control-Allow-Origin' header

This should work for fetch as well as for the ping endpoints. e.g.

> $ curl -v -H "Origin: mozilla.org" -d '{"locale": "en-US"}' http://127.0.0.1:5000/v3/links/click
> * Hostname was NOT found in DNS cache
> *   Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0)
> > POST /v3/links/click HTTP/1.1
> > User-Agent: curl/7.37.1
> > Host: 127.0.0.1:5000
> > Accept: */*
> > Origin: mozilla.org
> > Content-Length: 19
> > Content-Type: application/x-www-form-urlencoded
> >
> * upload completely sent off: 19 out of 19 bytes
> < HTTP/1.1 200 OK
> * Server gunicorn/18.0 is not blacklisted
> < Server: gunicorn/18.0
> < Date: Mon, 13 Jul 2015 14:49:59 GMT
> < Connection: keep-alive
> < Content-Type: application/json; charset=utf-8
> < Content-Length: 0
> < Access-Control-Allow-Origin: mozilla.org
(Assignee)

Comment 1

3 years ago
starting deployment
(Assignee)

Comment 2

3 years ago
canary deployed and tests passed, switching fully to new stack
Status: NEW → ASSIGNED
(Assignee)

Comment 3

3 years ago
new stack scaled up, old stack scaled down
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Seems to be working correctly

> $ curl -I -H "Origin: mozilla.org" https://tiles.services.mozilla.com/v3/links/fetch/en-US/beta
> HTTP/1.1 303 SEE OTHER
> Access-Control-Allow-Origin: mozilla.org
> Content-Length: 0
> Content-Type: text/html; charset=utf-8
> Date: Mon, 13 Jul 2015 20:24:44 GMT
> Location: https://tiles.cdn.mozilla.net/desktop-prerelease/CA/en-US.75746a9327aa6342d5e788cf6b620961c0a8d2b7.ag.json
> Connection: keep-alive
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.