Closed
Bug 772605
Opened 13 years ago
Closed 13 years ago
Consider allowing cross-origin requests for certain API calls
Categories
(addons.mozilla.org Graveyard :: API, defect)
addons.mozilla.org Graveyard
API
Tracking
(Not tracked)
RESOLVED
FIXED
2012-07-26
People
(Reporter: Fallen, Assigned: Fallen)
Details
Attachments
(1 file, 1 obsolete file)
4.98 KB,
patch
|
cvan
:
review+
|
Details | Diff | Splinter Review |
When we remake the Calendar website, I would like to include a widget with a download button like on AMO that displays the latest version.
To do so, I would like to make an XMLHttpRequest to https://services.addons.mozilla.org/en-US/thunderbird/api/1.5/addon/lightning and get the data from the XML.
Obviously, this will fail since our page is on www.mozilla.org so its cross-origin. Therefore I propose one of two things:
A) Allow cross origin calls for the API fully, i.e set Access-Control-Allow-Origin: * in the response headers.
B) Allow cross origin calls for all mozilla.org sites, i.e set Access-Control-Allow-Origin: $_REQUEST["HTTP_ORIGIN"] if the origin is part of mozilla.org.
What do you think?
Comment 1•13 years ago
|
||
We support cross-origin requests on our statistics data I don't think adding this to our other views would be a problem. I don't think we should add it universally though - the API continues to expand and adds new functionality (including functions other than just retrieving data) so I'd like to keep us on a whitelist system.
Assignee | ||
Comment 2•13 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #1)
> We support cross-origin requests on our statistics data I don't think adding
> this to our other views would be a problem. I don't think we should add it
> universally though - the API continues to expand and adds new functionality
> (including functions other than just retrieving data) so I'd like to keep us
> on a whitelist system.
Definitely, I was thinking the same when I wrote the bug but I see I forgot a few words to make that clear.
Assignee | ||
Comment 3•13 years ago
|
||
So, what are the next steps on this bug? I guess it won't make it into the 27th update, or is it an easy fix?
Comment 4•13 years ago
|
||
need a=rforbes and then, yeah, it's a low priority.
Assignee | ||
Comment 5•13 years ago
|
||
This should do it for the addon details, you just have to say what other api calls should have it allowed.
Assignee | ||
Comment 6•13 years ago
|
||
Comment on attachment 644683 [details] [diff] [review]
Fix - v1
Tests coming up shortly.
Attachment #644683 -
Attachment is obsolete: true
Attachment #644683 -
Flags: review?(clouserw)
Assignee | ||
Comment 7•13 years ago
|
||
This patch includes tests, choosing cvan for the review since he talked me through it on IRC (thanks!)
Attachment #644686 -
Flags: review?(cvan)
Comment 8•13 years ago
|
||
Comment on attachment 644686 [details] [diff] [review]
Fix - v2
Looks very good. I've made the small changes myself and merged in your patch: https://github.com/mozilla/zamboni/commit/dbfa18a
I wanted to make sure that your patch lands for our push this Thursday (7/26).
Thanks!
Attachment #644686 -
Flags: review?(cvan) → review+
Comment 9•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2012-07-26
Assignee | ||
Comment 10•13 years ago
|
||
Looks like you changed the line with the ^L control character, was that on purpose?
@@ -133,7 +133,7 @@ class ControlCharacterTest(TestCase):
- a.name = "I ove You"
+ a.name = "Iove You"
Comment 11•13 years ago
|
||
(In reply to Philipp Kewisch [:Fallen] from comment #10)
> Looks like you changed the line with the ^L control character, was that on
> purpose?
>
>
> @@ -133,7 +133,7 @@ class ControlCharacterTest(TestCase):
> - a.name = "I ove You"
> + a.name = "Iove You"
Yeah, I saw that. I'll fix it with a different editor. Test still passes (not surprisingly), but I'll amend it. Thanks.
Comment 12•13 years ago
|
||
just saw this. i am ok with it.
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•