Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Minds
Minds Backend - Engine
Commits
79f1c4b4
Commit
79f1c4b4
authored
Sep 06, 2019
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): Add missing x-version from CORS header
parent
29d07b79
Pipeline
#80750455
failed with stages
in 4 minutes and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
Core/Router/Middleware/ProMiddleware.php
Core/Router/Middleware/ProMiddleware.php
+1
-9
No files found.
Core/Router/Middleware/ProMiddleware.php
View file @
79f1c4b4
...
...
@@ -37,20 +37,12 @@ class ProMiddleware implements RouterMiddleware
{
$origin
=
$request
->
getServerParams
()[
'HTTP_ORIGIN'
];
$host
=
parse_url
(
$origin
,
PHP_URL_HOST
);
// var_dump('server');
// var_dump($_SERVER);
// var_dump('origin');
// var_dump($origin);
// var_dump('host');
// var_dump($host);
if
(
!
$host
)
{
return
;
}
$settings
=
$this
->
proDomain
->
lookup
(
$host
);
// var_dump('settings');
// var_dump($settings);
if
(
!
$settings
)
{
return
;
...
...
@@ -62,7 +54,7 @@ class ProMiddleware implements RouterMiddleware
header
(
'Access-Control-Allow-Credentials: true'
);
header
(
'Access-Control-Max-Age: 86400'
);
header
(
'Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS'
);
header
(
'Access-Control-Allow-Headers: Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,X-No-Cache,x-xsrf-token,x-minds-origin'
);
header
(
'Access-Control-Allow-Headers: Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,X-No-Cache,x-xsrf-token,x-minds-origin
,x-version
'
);
if
(
$request
->
getMethod
()
===
'OPTIONS'
)
{
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment