@Internal public final class CaseInsensitiveMutableHttpHeaders extends Object implements MutableHttpHeaders
MutableHttpHeaders
implementation that is case-insensitive.GMT
ACCEPT, ACCEPT_CH, ACCEPT_CH_LIFETIME, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_PATCH, ACCEPT_RANGES, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, AGE, ALLOW, AUTHORIZATION, AUTHORIZATION_INFO, CACHE_CONTROL, CONNECTION, CONTENT_BASE, CONTENT_DISPOSITION, CONTENT_DPR, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, CROSS_ORIGIN_RESOURCE_POLICY, DATE, DEVICE_MEMORY, DOWNLINK, DPR, ECT, ETAG, EXPECT, EXPIRES, FEATURE_POLICY, FORWARDED, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, REFERRER_POLICY, RETRY_AFTER, RTT, SAVE_DATA, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_KEY1, SEC_WEBSOCKET_KEY2, SEC_WEBSOCKET_LOCATION, SEC_WEBSOCKET_ORIGIN, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION, SERVER, SET_COOKIE, SET_COOKIE2, SOURCE_MAP, STANDARD_HEADERS, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, VIEWPORT_WIDTH, WARNING, WEBSOCKET_LOCATION, WEBSOCKET_ORIGIN, WEBSOCKET_PROTOCOL, WIDTH, WWW_AUTHENTICATE, X_AUTH_TOKEN
EMPTY
Constructor and Description |
---|
CaseInsensitiveMutableHttpHeaders(boolean validate,
ConversionService<?> conversionService)
Create an empty CaseInsensitiveMutableHttpHeaders.
|
CaseInsensitiveMutableHttpHeaders(boolean validate,
Map<String,List<String>> defaults,
ConversionService<?> conversionService)
Create a CaseInsensitiveMutableHttpHeaders populated by the entries in the provided Map<String,String>.
|
CaseInsensitiveMutableHttpHeaders(ConversionService<?> conversionService)
Create an empty CaseInsensitiveMutableHttpHeaders.
|
CaseInsensitiveMutableHttpHeaders(Map<String,List<String>> defaults,
ConversionService<?> conversionService)
Create a CaseInsensitiveMutableHttpHeaders populated by the entries in the provided Map<String,String>.
|
Modifier and Type | Method and Description |
---|---|
MutableHttpHeaders |
add(CharSequence header,
CharSequence value)
Add a header for the given name and value.
|
String |
get(CharSequence name)
Get a value without applying any conversion.
|
<T> Optional<T> |
get(CharSequence name,
ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name.
|
List<String> |
getAll(CharSequence name)
Get all the values for the given name without applying conversion.
|
Set<String> |
names() |
MutableHttpHeaders |
remove(CharSequence header)
Removes a header.
|
Collection<List<String>> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, allow, allow, allowGeneric, auth, auth, contentType, date, date, expires, expires, ifModifiedSince, ifModifiedSince, lastModified, lastModified, location, set
accept, contentLength, contentType, findDate, findFirst, findInt, getAuthorization, getContentType, getDate, getInt, getOrigin, isKeepAlive
empty, forEach, forEachValue, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iterator, of
asMap, asMap, asProperties, contains, getValue, getValueType, of, subMap, subMap, subMap
get, get, get
forEach, spliterator
public CaseInsensitiveMutableHttpHeaders(ConversionService<?> conversionService)
conversionService
- The conversion servicepublic CaseInsensitiveMutableHttpHeaders(boolean validate, ConversionService<?> conversionService)
validate
- Whether to validate the headersconversionService
- The conversion servicepublic CaseInsensitiveMutableHttpHeaders(Map<String,List<String>> defaults, ConversionService<?> conversionService)
defaults
- The defaultsconversionService
- The conversion servicepublic CaseInsensitiveMutableHttpHeaders(boolean validate, Map<String,List<String>> defaults, ConversionService<?> conversionService)
Warning! Setting validate
to false
will not validate header names and values, and can leave your server implementation vulnerable to
CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting').
validate
- Whether to validate the headersdefaults
- The defaultsconversionService
- The conversion servicepublic List<String> getAll(CharSequence name)
ConvertibleMultiValues
getAll
in interface ConvertibleMultiValues<String>
name
- The header name@Nullable public String get(CharSequence name)
ConvertibleMultiValues
get
in interface ConvertibleMultiValues<String>
name
- The name of the valueConvertibleMultiValues.getFirst(CharSequence)
public Set<String> names()
names
in interface ConvertibleValues<List<String>>
public Collection<List<String>> values()
values
in interface ConvertibleValues<List<String>>
public <T> Optional<T> get(CharSequence name, ArgumentConversionContext<T> conversionContext)
ValueResolver
get
in interface ValueResolver<CharSequence>
T
- The concrete typename
- The nameconversionContext
- The conversion contextpublic MutableHttpHeaders add(CharSequence header, CharSequence value)
MutableHttpHeaders
add
in interface MutableHeaders
add
in interface MutableHttpHeaders
header
- The header namevalue
- The valuepublic MutableHttpHeaders remove(CharSequence header)
MutableHeaders
remove
in interface MutableHeaders
remove
in interface MutableHttpHeaders
header
- The header to remove