mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Changed value returned in Access-Control-Allow-Origin so that it is always set to '*'
This commit is contained in:
parent
f57303f8c0
commit
76aa6502db
@ -32,7 +32,7 @@ class CrossDomainMiddleware implements MiddlewareInterface, RequestMethodInterfa
|
||||
}
|
||||
|
||||
// Add Allow-Origin header
|
||||
$response = $response->withHeader('Access-Control-Allow-Origin', $request->getHeader('Origin'));
|
||||
$response = $response->withHeader('Access-Control-Allow-Origin', '*');
|
||||
if ($request->getMethod() !== self::METHOD_OPTIONS) {
|
||||
return $response;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class CorsTest extends ApiTestCase
|
||||
]);
|
||||
|
||||
self::assertEquals($expectedStatusCode, $resp->getStatusCode());
|
||||
self::assertEquals($origin, $resp->getHeaderLine('Access-Control-Allow-Origin'));
|
||||
self::assertEquals('*', $resp->getHeaderLine('Access-Control-Allow-Origin'));
|
||||
self::assertFalse($resp->hasHeader('Access-Control-Allow-Methods'));
|
||||
self::assertFalse($resp->hasHeader('Access-Control-Max-Age'));
|
||||
self::assertFalse($resp->hasHeader('Access-Control-Allow-Headers'));
|
||||
|
@ -61,7 +61,7 @@ class CrossDomainMiddlewareTest extends TestCase
|
||||
|
||||
$headers = $response->getHeaders();
|
||||
|
||||
self::assertEquals('local', $response->getHeaderLine('Access-Control-Allow-Origin'));
|
||||
self::assertEquals('*', $response->getHeaderLine('Access-Control-Allow-Origin'));
|
||||
self::assertArrayNotHasKey('Access-Control-Allow-Methods', $headers);
|
||||
self::assertArrayNotHasKey('Access-Control-Max-Age', $headers);
|
||||
self::assertArrayNotHasKey('Access-Control-Allow-Headers', $headers);
|
||||
@ -82,7 +82,7 @@ class CrossDomainMiddlewareTest extends TestCase
|
||||
|
||||
$headers = $response->getHeaders();
|
||||
|
||||
self::assertEquals('local', $response->getHeaderLine('Access-Control-Allow-Origin'));
|
||||
self::assertEquals('*', $response->getHeaderLine('Access-Control-Allow-Origin'));
|
||||
self::assertArrayHasKey('Access-Control-Allow-Methods', $headers);
|
||||
self::assertEquals('1000', $response->getHeaderLine('Access-Control-Max-Age'));
|
||||
self::assertEquals('foo, bar, baz', $response->getHeaderLine('Access-Control-Allow-Headers'));
|
||||
|
Loading…
Reference in New Issue
Block a user