spring-framework / org.springframework.web.accept / ContentNegotiationManagerFactoryBean / setMediaTypes

setMediaTypes

open fun setMediaTypes(mediaTypes: Properties): Unit

Add a mapping from a key, extracted from a path extension or a query parameter, to a MediaType. This is required in order for the parameter strategy to work. Any extensions explicitly registered here are also whitelisted for the purpose of Reflected File Download attack detection (see Spring Framework reference documentation for more details on RFD attack protection).

The path extension strategy will also try to use ServletContext#getMimeType and org.springframework.http.MediaTypeFactory to resolve path extensions.

Parameters

mediaTypes - media type mappings

See Also
#addMediaType(String, MediaType)#addMediaTypes(Map)