0

POST failse on firefox because of Access-Control-Allow-Origin

Hi,

I have been working on [Github Gist](http://gist.github.com/) API library for JavaScript and a [bespin plugin](https://labs.mozilla.org/bespin) on top of it. Library is a wrapper js code of YQL tables. Both tables and library can be [found here](http://github.com/Gozala/github/tree/bespin). Since idea is to create / edit gists http GET is not enough cause of a size limit. So I'm forced to use http POST.

Issue I'm running into is Firefox specific which sends http OPTIONS in cross site XHR's. Unfortunately YQL service doesn't reply's with Access-Control-Allow-Origin: * on http OPTIONS which makes it fail on firefox.

Here is an example of a request:

Request
CODE
HTTP/1.1 200 OK
Date: Sun, 11 Apr 2010 16:14:43 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS
Vary: Accept-Encoding
Content-Type: text/plain; charset=utf-8
Cache-Control: private
Age: 0
Transfer-Encoding: chunked
Connection: keep-alive
Server: YTS/1.17.21

Response
CODE
OPTIONS /v1/public/yql HTTP/1.1
Host: query.yahooapis.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 FirePHP/0.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Origin: http://localhost:4020
Access-Control-Request-Method: POST


If response will contain header

CODE
Access-Control-Allow-Origin: *


everything will work nicely in Firefox as well

Thanks a lot for help in advance

by
4 Replies
  • Thanks for the information. We'll take a look at updating the cross domain file.

    Jonathan
    0
  • QUOTE (Jonathan @ Apr 12 2010, 07:56 AM) <{POST_SNAPBACK}>
    Thanks for the information. We'll take a look at updating the cross domain file.

    Jonathan


    Thanks a lot! Can you please drop a message once it's done.
    0
  • Any news about this issue ?
    0
  • QUOTE (rfobic @ Apr 21 2010, 07:44 AM) <{POST_SNAPBACK}>
    Any news about this issue ?


    We're looking at getting this into the next release.

    Jonathan
    0

Recent Posts

in YQL