Last active
June 17, 2019 04:27
-
-
Save r-brown/bfb576d0dd4cf33d7d63 to your computer and use it in GitHub Desktop.
Apache HTTPD configuration - Enable CORS for NetLicensing API (RESTful)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost netlicensing.labs64.com:443> | |
... | |
<Location /core> | |
# CORS withCredentials=false (without cookies) | |
Header always set Access-Control-Allow-Origin "*" | |
Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" | |
Header always set Access-Control-Allow-Headers "Content-Type, Accept, Authorization" | |
Header always set Access-Control-Max-Age: "3600" | |
RewriteEngine On | |
RewriteCond %{REQUEST_METHOD} OPTIONS | |
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]] | |
# CORS withCredentials=true (with cookies) | |
SetEnvIfNoCase ORIGIN (.*) ORIGIN=$1 | |
Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" | |
Header always set Access-Control-Allow-Origin "%{ORIGIN}e" | |
Header always set Access-Control-Allow-Credentials "true" | |
Header always set Access-Control-Allow-Headers "Content-Type, Accept, Authorization" | |
Header always set Access-Control-Max-Age: "3600" | |
RewriteEngine On | |
RewriteCond %{REQUEST_METHOD} OPTIONS | |
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}] | |
</Location> | |
... | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test URL: http://io.labs64.com/NetLicensing-API/