Solved

How to set HTTP Request Headers on Mac

Posted on 2014-10-17
2
231 Views
Last Modified: 2014-10-21
Hey all.

I am trying to run our website from my local machine and am having cross origin issues. Here is the error.

XMLHttpRequest cannot load http://internaldomain/<pathtofile> No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mymachine.mycompany.com' is therefore not allowed access.

How do I set the access-control-allow-origin? I've googled it and have seen examples of PHP code, but I was thinking there would be a way to modify the configuration for the Apache running on my Mac.

Is it a matter of modifying the Apache configuration and if so, how is that done on a Mac?
0
Comment
Question by:Webspeeder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40388062
See if this page helps:  http://enable-cors.org/server_apache.html  I don't have a server or code that I can use to test it.
0
 
LVL 33

Expert Comment

by:shalomc
ID: 40389319
From a security perspective, Setting the access control for all is not necessarily what you have in mind.
Access-Control-Allow-Origin   *

Therefore, I always recommend to limit the cross domain access to the relevant origin domains, and use a wildcard only when you actually need a wildcard.
Access-Control-Allow-Origin  http://mymachine.mycompany.com
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

617 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