Solved

Bypass cross origin issues on development site

Posted on 2016-11-30
3
21 Views
Last Modified: 2016-11-30
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
Comment
Question by:bbdesign
3 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 250 total points
ID: 41907643
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
 
LVL 14

Assisted Solution

by:Juan Ocasio
Juan Ocasio earned 250 total points
ID: 41907647
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
 

Author Comment

by:bbdesign
ID: 41907728
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now