fix dev docker-compose env cors issues
This commit is contained in:
parent
38c2357856
commit
6037c81cbe
1
docker/fitness/.env
Normal file
1
docker/fitness/.env
Normal file
@ -0,0 +1 @@
|
||||
FITNESS_REST_ALLOW_VERIFY_ONLY=true
|
||||
@ -22,6 +22,7 @@ services:
|
||||
FITNESS_MAIL_PORT: 1025
|
||||
FITNESS_MAIL_USERNAME: test
|
||||
FITNESS_MAIL_PASSWORD: test
|
||||
FITNESS_REST_ALLOW_VERIFY_ONLY: $FITNESS_REST_ALLOW_VERIFY_ONLY
|
||||
|
||||
cutlerdb:
|
||||
image: mariadb:10.1
|
||||
|
||||
@ -28,15 +28,15 @@
|
||||
#Include conf-available/serve-cgi-bin.conf
|
||||
|
||||
# Always set these headers.
|
||||
Header always set Access-Control-Allow-Origin "*"
|
||||
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||
Header always set Access-Control-Max-Age "1000"
|
||||
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||
#Header always set Access-Control-Allow-Origin "*"
|
||||
#Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
|
||||
#Header always set Access-Control-Max-Age "1000"
|
||||
#Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
|
||||
|
||||
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||
RewriteRule ^(.*)$ $1 [R=200,L]
|
||||
# RewriteEngine On
|
||||
# RewriteCond %{REQUEST_METHOD} OPTIONS
|
||||
# RewriteRule ^(.*)$ $1 [R=200,L]
|
||||
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a href="fitness_web/backend/web/index.php">Fitness Web Backend</a>
|
||||
<a href="cutler/backend/web/index.php">Fitness Web Backend</a>
|
||||
<br>
|
||||
<a href="fitness_web/frontend/web/index.php">Fitness Web Frontend</a>
|
||||
<a href="cutler/frontend/web/index.php">Fitness Web Frontend</a>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
0
mobileapi.http
Normal file
0
mobileapi.http
Normal file
@ -33,7 +33,7 @@ class CorsFilter extends ActionFilter
|
||||
$this->request = \Yii::$app->getRequest();
|
||||
$this->response = \Yii::$app->getResponse();
|
||||
$origin = $this->request->headers->get('origin');
|
||||
\Yii::error("origin", $origin);
|
||||
// \Yii::error("origin is:". $origin);
|
||||
|
||||
$isOriginAllowed = array_search($origin, $this->allowedOrigins, true);
|
||||
if ($isOriginAllowed >= 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user