Module io.helidon.webserver.cors
Package io.helidon.webserver.cors
Interface CorsSupportBase.ResponseAdapter<T>
-
- Type Parameters:
T
- the type of the response wrapped by the adapter
- Enclosing class:
- CorsSupportBase<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>>
protected static interface CorsSupportBase.ResponseAdapter<T>
Not for use by developers. Minimal abstraction of an HTTP response.Note to implementers: In some use cases, the CORS support code will invoke the
header
methods but notok
orforbidden
. See to it that header values set on the adapter via theheader
methods are propagated to the actual response.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
forbidden(String message)
Returns a response with the forbidden status and the specified error message, without any headers assigned using theheader
methods.CorsSupportBase.ResponseAdapter<T>
header(String key, Object value)
Arranges to add the specified header and value to the eventual response.CorsSupportBase.ResponseAdapter<T>
header(String key, String value)
Arranges to add the specified header and value to the eventual response.T
ok()
Returns a response with only the headers that were set on this adapter and the status set to OK.int
status()
Returns the status of the response.
-
-
-
Method Detail
-
header
CorsSupportBase.ResponseAdapter<T> header(String key, String value)
Arranges to add the specified header and value to the eventual response.- Parameters:
key
- header name to addvalue
- header value to add- Returns:
- the adapter
-
header
CorsSupportBase.ResponseAdapter<T> header(String key, Object value)
Arranges to add the specified header and value to the eventual response.- Parameters:
key
- header name to addvalue
- header value to add- Returns:
- the adapter
-
forbidden
T forbidden(String message)
Returns a response with the forbidden status and the specified error message, without any headers assigned using theheader
methods.- Parameters:
message
- error message to use in setting the response status- Returns:
- the factory
-
ok
T ok()
Returns a response with only the headers that were set on this adapter and the status set to OK.- Returns:
- response instance
-
status
int status()
Returns the status of the response.- Returns:
- HTTP status code.
-
-