fix dev docker-compose env cors issues

This commit is contained in:
Schneider Roland 2023-01-18 19:01:21 +01:00
parent 38c2357856
commit 6037c81cbe
6 changed files with 12 additions and 10 deletions

1
docker/fitness/.env Normal file
View File

@ -0,0 +1 @@
FITNESS_REST_ALLOW_VERIFY_ONLY=true

View File

@ -22,6 +22,7 @@ services:
FITNESS_MAIL_PORT: 1025 FITNESS_MAIL_PORT: 1025
FITNESS_MAIL_USERNAME: test FITNESS_MAIL_USERNAME: test
FITNESS_MAIL_PASSWORD: test FITNESS_MAIL_PASSWORD: test
FITNESS_REST_ALLOW_VERIFY_ONLY: $FITNESS_REST_ALLOW_VERIFY_ONLY
cutlerdb: cutlerdb:
image: mariadb:10.1 image: mariadb:10.1

View File

@ -28,15 +28,15 @@
#Include conf-available/serve-cgi-bin.conf #Include conf-available/serve-cgi-bin.conf
# Always set these headers. # Always set these headers.
Header always set Access-Control-Allow-Origin "*" #Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" #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-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-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. # Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On # RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS # RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L] # RewriteRule ^(.*)$ $1 [R=200,L]
</VirtualHost> </VirtualHost>

View File

@ -3,9 +3,9 @@
</head> </head>
<body> <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> <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> </body>
</html> </html>

0
mobileapi.http Normal file
View File

View File

@ -33,7 +33,7 @@ class CorsFilter extends ActionFilter
$this->request = \Yii::$app->getRequest(); $this->request = \Yii::$app->getRequest();
$this->response = \Yii::$app->getResponse(); $this->response = \Yii::$app->getResponse();
$origin = $this->request->headers->get('origin'); $origin = $this->request->headers->get('origin');
\Yii::error("origin", $origin); // \Yii::error("origin is:". $origin);
$isOriginAllowed = array_search($origin, $this->allowedOrigins, true); $isOriginAllowed = array_search($origin, $this->allowedOrigins, true);
if ($isOriginAllowed >= 0) { if ($isOriginAllowed >= 0) {