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
Solved

How to set HTTP Request Headers on Mac

Posted on 2014-10-17
2
220 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

A few customers have recently asked my thoughts on Password Managers.  As Security is a big part of our industry I was initially very hesitant and sceptical about giving a program all of my secret passwords.  But as I was getting asked about them mo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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