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>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(io.vertx.ext.web.RoutingContext event) static booleanisConfiguredWithWildcard(Optional<List<String>> optionalList) static booleanisOriginAllowedByRegex(List<Pattern> allowOriginsRegex, String origin) If any regular expression origins are configured, try to match on them.(package private) static booleanisSameOrigin(io.vertx.core.http.HttpServerRequest request, String origin) (package private) static booleanisSameOriginSlowPath(io.vertx.core.http.HttpServerRequest request, String origin) parseAllowedOriginsRegex(Optional<List<String>> allowedOrigins) Parse the provided allowed origins for any regexes(package private) static booleansubstringMatch(String str, int pos, String substring, boolean requireFull)
-
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:
handlein interfaceio.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
-
isSameOrigin
-
isSameOriginSlowPath
-
substringMatch
-