Package io.micronaut.http.server.cors
Class CrossOriginUtil
java.lang.Object
io.micronaut.http.server.cors.CrossOriginUtil
Utility classes to work with
CrossOrigin
.- Since:
- 3.9.0
- Author:
- Sergio del Amo
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<CorsOriginConfiguration>
getCorsOriginConfiguration
(@NonNull AnnotationMetadata annotationMetadata) static @NonNull Optional<CorsOriginConfiguration>
getCorsOriginConfigurationForRequest
(@NonNull HttpRequest<?> request)
-
Field Details
-
MEMBER_ALLOWED_ORIGINS
- See Also:
-
MEMBER_ALLOWED_ORIGINS_REGEX
- See Also:
-
MEMBER_ALLOWED_HEADERS
- See Also:
-
MEMBER_EXPOSED_HEADERS
- See Also:
-
MEMBER_ALLOWED_METHODS
- See Also:
-
MEMBER_ALLOW_CREDENTIALS
- See Also:
-
MEMBER_ALLOW_PRIVATE_NETWORK
- See Also:
-
MEMBER_MAX_AGE
- See Also:
-
-
Method Details
-
getCorsOriginConfigurationForRequest
@NonNull public static @NonNull Optional<CorsOriginConfiguration> getCorsOriginConfigurationForRequest(@NonNull @NonNull HttpRequest<?> request) - Parameters:
request
- the HTTP request for the configuration- Returns:
- the cors origin configuration for the given request
-
getCorsOriginConfiguration
public static Optional<CorsOriginConfiguration> getCorsOriginConfiguration(@NonNull @NonNull AnnotationMetadata annotationMetadata) - Parameters:
annotationMetadata
- The route annotation metadata- Returns:
- The possible CORS configuration
-