Package com.linecorp.armeria.server.cors
Class CorsService
java.lang.Object
com.linecorp.armeria.common.util.AbstractUnwrappable<Service<T_I,T_O>>
com.linecorp.armeria.server.DecoratingService<I,O,I,O>
com.linecorp.armeria.server.SimpleDecoratingService<HttpRequest,HttpResponse>
com.linecorp.armeria.server.SimpleDecoratingHttpService
com.linecorp.armeria.server.cors.CorsService
- All Implemented Interfaces:
Unwrappable
,HttpService
,Service<HttpRequest,HttpResponse>
public final class CorsService extends SimpleDecoratingHttpService
Decorates an
HttpService
to add the
Cross-Origin Resource Sharing
(CORS) support.- See Also:
CorsServiceBuilder
-
Method Summary
Modifier and Type Method Description static CorsServiceBuilder
builder(Iterable<String> origins)
Returns a newCorsServiceBuilder
with the specifiedorigins
.static CorsServiceBuilder
builder(String... origins)
Returns a newCorsServiceBuilder
with the specifiedorigins
.static CorsServiceBuilder
builderForAnyOrigin()
Returns a newCorsServiceBuilder
with its origin set with"*"
(any origin).CorsConfig
config()
Returns theCorsConfig
.HttpResponse
serve(ServiceRequestContext ctx, HttpRequest req)
Serves an incomingRequest
.Methods inherited from class com.linecorp.armeria.server.DecoratingService
serviceAdded, shouldCachePath
Methods inherited from class com.linecorp.armeria.common.util.AbstractUnwrappable
as, toString, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
-
Method Details
-
builderForAnyOrigin
Returns a newCorsServiceBuilder
with its origin set with"*"
(any origin). -
builder
Returns a newCorsServiceBuilder
with the specifiedorigins
. -
builder
Returns a newCorsServiceBuilder
with the specifiedorigins
. -
config
Returns theCorsConfig
. -
serve
Description copied from interface:Service
Serves an incomingRequest
.
-