KEYCLOAK-5946 Make sure wildcard origin is never returned
This commit is contained in:
parent
4541acc628
commit
c3d9f4704e
2 changed files with 2 additions and 6 deletions
|
@ -148,11 +148,7 @@ public class Cors {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
if (allowedOrigins != null && allowedOrigins.contains(ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD)) {
|
||||
builder.header(ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD);
|
||||
} else {
|
||||
builder.header(ACCESS_CONTROL_ALLOW_ORIGIN, origin);
|
||||
}
|
||||
builder.header(ACCESS_CONTROL_ALLOW_ORIGIN, origin);
|
||||
|
||||
if (preflight) {
|
||||
if (allowedMethods != null) {
|
||||
|
|
|
@ -154,7 +154,7 @@ public class OIDCWellKnownProviderTest extends AbstractKeycloakTest {
|
|||
request.header(Cors.ORIGIN_HEADER, "http://somehost");
|
||||
Response response = request.get();
|
||||
|
||||
assertEquals("*", response.getHeaders().getFirst(Cors.ACCESS_CONTROL_ALLOW_ORIGIN));
|
||||
assertEquals("http://somehost", response.getHeaders().getFirst(Cors.ACCESS_CONTROL_ALLOW_ORIGIN));
|
||||
}
|
||||
|
||||
private OIDCConfigurationRepresentation getOIDCDiscoveryConfiguration(Client client) {
|
||||
|
|
Loading…
Reference in a new issue