CORS headers

49 views
Skip to first unread message

Andrew Nicklin

unread,
Mar 1, 2015, 11:48:57 PM3/1/15
to fifty-sta...@googlegroups.com
Any chance of adding the Access-Control-Allow-Origin=* header to server responses for GET requests to the entire OpenStates API? (This header is already implemented OpenCivicData API, but that one doesn't seem to be handling queries very well - lots of HTTP 500 errors coming back.)

This would make it easier to develop browser-based clients without needing app/proxy server intermediaries. Great for prototyping, too.

Thanks,
-Andrew

Paul Tagliamonte

unread,
Mar 2, 2015, 12:03:39 PM3/2/15
to fifty-sta...@googlegroups.com
Hey Andrew,

I'm sure we can do this, I'll see if I can't push an update out

Thanks!
  Paul

--
You received this message because you are subscribed to the Google Groups "Open State Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fifty-state-pro...@googlegroups.com.
To post to this group, send email to fifty-sta...@googlegroups.com.
Visit this group at http://groups.google.com/group/fifty-state-project.
For more options, visit https://groups.google.com/d/optout.



--
Paul Tagliamonte
Software Developer | Sunlight Foundation

Paul Tagliamonte

unread,
Mar 4, 2015, 2:22:49 PM3/4/15
to fifty-sta...@googlegroups.com
Hey Andrew,

Just flipped that on -- give it a shot!

Thanks!
  Paul

On Sun, Mar 1, 2015 at 10:04 PM, Andrew Nicklin <andrew....@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Open State Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fifty-state-pro...@googlegroups.com.
To post to this group, send email to fifty-sta...@googlegroups.com.
Visit this group at http://groups.google.com/group/fifty-state-project.
For more options, visit https://groups.google.com/d/optout.

Andrew Nicklin

unread,
Mar 5, 2015, 1:29:16 AM3/5/15
to fifty-sta...@googlegroups.com
Thank you. I am still having difficulties.

The HTTP response I receive from the API now seems to contain two Access-Control-Allow-Origin= headers; one correctly indicating *; the other indicating the domain from where browser code is served (in this case, technickle.github.io). The browsers I have tried (Chrome, Safari, Firefox - all on OSX Yosemite) don't seem to like this and default to denying access.

-Andrew

On Wednesday, March 4, 2015 at 2:22:49 PM UTC-5, Paul Tagliamonte wrote:
Hey Andrew,

Just flipped that on -- give it a shot!

Thanks!
  Paul

On Sun, Mar 1, 2015 at 10:04 PM, Andrew Nicklin <andrew....@gmail.com> wrote:
Any chance of adding the Access-Control-Allow-Origin=* header to server responses for GET requests to the entire OpenStates API? (This header is already implemented OpenCivicData API, but that one doesn't seem to be handling queries very well - lots of HTTP 500 errors coming back.)

This would make it easier to develop browser-based clients without needing app/proxy server intermediaries. Great for prototyping, too.

Thanks,
-Andrew
--

Paul Tagliamonte

unread,
Mar 5, 2015, 9:57:17 AM3/5/15
to fifty-sta...@googlegroups.com
Hey Andrew,


I just found this out a few minutes ago, I'm getting that second one removed, there's no added advantage to limiting it like that :)

Thanks,
  Paul

--
You received this message because you are subscribed to the Google Groups "Open State Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fifty-state-pro...@googlegroups.com.
To post to this group, send email to fifty-sta...@googlegroups.com.
Visit this group at http://groups.google.com/group/fifty-state-project.
For more options, visit https://groups.google.com/d/optout.

Paul Tagliamonte

unread,
Mar 5, 2015, 11:42:44 AM3/5/15
to fifty-sta...@googlegroups.com
Should be set now!

Thanks!
  Paul

Andrew Nicklin

unread,
Mar 5, 2015, 9:54:00 PM3/5/15
to fifty-sta...@googlegroups.com
Ahh, brilliant! Working like a charm. Thanks ever so much!

-Andrew
--
Paul Tagliamonte
Software Developer | Sunlight Foundation
Reply all
Reply to author
Forward
0 new messages