Solved

How to set HTTP Request Headers on Mac

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

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 32

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 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

19 Experts available now in Live!

Get 1:1 Help Now