• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

Bypass cross origin issues on development site

I am testing my website locally on a Mac in Firefox.

I have a Microsoft IIS server where ASP scripts are located.

My local Javascript file references a script like this:

$.get('http://www.domain.com/_script.asp', {email:email}, function(result){...

Open in new window


Of course, when I test my local website, I get Cross-Origin Request Blocked errors in Firefox. It isn't clear to me if these errors are coming from Firefox (local computer) or from the server. Or both?

At least for testing purposes, is it possible for me to bypass these errors? I don't want to permanently undo any security settings. After the website goes live I would want it as it is now. But for testing, it would be really convenient if I could access those scripts from my local development site.

Thank you.
0
bbdesign
Asked:
bbdesign
2 Solutions
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
taken from here

Chrome has a wonderful command line argument to disable web security.  To start Chrome with web security disabled, run the following command:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security
0
 
Juan OcasioCommented:
Try adding the following to web.config:
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>
0
 
bbdesignAuthor Commented:
web.config isn't an option for me, unfortunately, because I am on IIS 6.

I found a Firefox add-on called "cors everywhere" which seems to do the trick. Similar to the Google Chrome suggestion. I didn't realize the setting was in the browser and could be controlled in that way.

Thanks for the input!
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now