Class CORSFilter
java.lang.Object
io.quarkus.vertx.http.runtime.cors.CORSFilter
- All Implemented Interfaces:
io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
public class CORSFilter
extends Object
implements io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(io.vertx.ext.web.RoutingContext event) static boolean
isConfiguredWithWildcard
(Optional<List<String>> optionalList) static boolean
isOriginAllowedByRegex
(List<Pattern> allowOriginsRegex, String origin) If any regular expression origins are configured, try to match on them.(package private) static boolean
isSameOrigin
(io.vertx.core.http.HttpServerRequest request, String origin) (package private) static boolean
isSameOriginSlowPath
(io.vertx.core.http.HttpServerRequest request, String origin) parseAllowedOriginsRegex
(Optional<List<String>> allowedOrigins) Parse the provided allowed origins for any regexes(package private) static boolean
substringMatch
(String str, int pos, String substring, boolean requireFull)
-
Field Details
-
corsConfig
-
-
Constructor Details
-
CORSFilter
-
-
Method Details
-
isConfiguredWithWildcard
-
parseAllowedOriginsRegex
Parse the provided allowed origins for any regexes- Parameters:
allowedOrigins
-- Returns:
- a list of compiled regular expressions. If none configured, and empty list is returned
-
isOriginAllowedByRegex
If any regular expression origins are configured, try to match on them. Regular expressions must begin and end with '/'- Parameters:
allowOriginsRegex
- the configured regex origins.origin
- the specified origin- Returns:
- true if any configured regular expressions match the specified origin, false otherwise
-
handle
public void handle(io.vertx.ext.web.RoutingContext event) - Specified by:
handle
in interfaceio.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
-
isSameOrigin
-
isSameOriginSlowPath
-
substringMatch
-