Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
163
rated 0 times [  166] [ 3]  / answers: 1 / hits: 122422  / 15 Years ago, fri, march 20, 2009, 12:00:00

I need to temporally allow cross domain XMLHttpRequest. Changing firefox security setting seems to be the way to go. But I've tried with this and this but they didnt work. Has anyone been able to configure this before? Thanks.


More From » http

 Answers
13

For modern browsers, you may try the following approach:



https://developer.mozilla.org/en/HTTP_access_control



In short, you need to add the following into the SERVER response header (the following allows access from foo.example):



Access-Control-Allow-Origin: http://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-PINGOTHER
Access-Control-Max-Age: 1728000


Note that the X-PINGOTHER is the custom header that is inserted by JavaScript, and should differ from site to site.



If you want any site access your server in Ajax, use * instead.






Edit:



When I first answered the question by 2009, I actually hit the same problem, and I worked around it using the server side config.



There was no plugin on FF or Chrome by then.



However, now we do have alternatives using the browser side plugin, please check the answer of tsds


[#99814] Monday, March 16, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaquelineh

Total Points: 360
Total Questions: 105
Total Answers: 114

Location: Saint Pierre and Miquelon
Member since Fri, Jan 28, 2022
2 Years ago
;