Skip to content

Commit 39a655e

Browse files
phillip-krugergsmet
authored andcommitted
OpenAPI change to use MultiMap rather than Map
Signed-off-by:Phillip Kruger <[email protected]> (cherry picked from commit 123a898)
1 parent bbe9893 commit 39a655e

File tree

1 file changed

+8
-8
lines changed
  • extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime

1 file changed

+8
-8
lines changed

extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiHandler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package io.quarkus.smallrye.openapi.runtime;
22

3-
import java.util.HashMap;
43
import java.util.List;
5-
import java.util.Map;
64

75
import io.quarkus.arc.Arc;
86
import io.smallrye.openapi.runtime.io.Format;
97
import io.vertx.core.Handler;
8+
import io.vertx.core.MultiMap;
109
import io.vertx.core.buffer.Buffer;
1110
import io.vertx.core.http.HttpMethod;
1211
import io.vertx.core.http.HttpServerRequest;
1312
import io.vertx.core.http.HttpServerResponse;
13+
import io.vertx.core.http.impl.headers.HeadersMultiMap;
1414
import io.vertx.ext.web.RoutingContext;
1515

1616
/**
@@ -21,14 +21,14 @@ public class OpenApiHandler implements Handler<RoutingContext> {
2121
private volatile OpenApiDocumentService openApiDocumentService;
2222
private static final String ALLOWED_METHODS = "GET, HEAD, OPTIONS";
2323
private static final String QUERY_PARAM_FORMAT = "format";
24-
private static final Map<String, String> RESPONSE_HEADERS = new HashMap<>();
24+
private static final MultiMap RESPONSE_HEADERS = new HeadersMultiMap();
2525

2626
static {
27-
RESPONSE_HEADERS.put("Access-Control-Allow-Origin", "*");
28-
RESPONSE_HEADERS.put("Access-Control-Allow-Credentials", "true");
29-
RESPONSE_HEADERS.put("Access-Control-Allow-Methods", ALLOWED_METHODS);
30-
RESPONSE_HEADERS.put("Access-Control-Allow-Headers", "Content-Type, Authorization");
31-
RESPONSE_HEADERS.put("Access-Control-Max-Age", "86400");
27+
RESPONSE_HEADERS.add("access-control-allow-origin", "*");
28+
RESPONSE_HEADERS.add("access-control-allow-credentials", "true");
29+
RESPONSE_HEADERS.add("access-control-allow-methods", ALLOWED_METHODS);
30+
RESPONSE_HEADERS.add("access-control-allow-headers", "Content-Type, Authorization");
31+
RESPONSE_HEADERS.add("access-control-max-age", "86400");
3232
}
3333

3434
@Override

0 commit comments

Comments
 (0)