Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

How to set HTTP Request Headers on Mac

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
Webspeeder
Asked:
Webspeeder
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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
 
shalomcCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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