Liking cljdoc? Tell your friends :D

ring.middleware.content-type

Middleware for automatically adding a content type to response maps.

Middleware for automatically adding a content type to response maps.
raw docstring

content-type-responseclj

(content-type-response response request)
(content-type-response response request options)

Adds a content-type header to response. See: wrap-content-type.

Adds a content-type header to response. See: wrap-content-type.
sourceraw docstring

wrap-content-typeclj

(wrap-content-type handler)
(wrap-content-type handler options)

Middleware that adds a content-type header to the response if one is not set by the handler. Uses the ring.util.mime-type/ext-mime-type function to guess the content-type from the file extension in the URI. If no content-type can be found, it defaults to 'application/octet-stream'.

Accepts the following options:

:mime-types - a map of filename extensions to mime-types that will be used in addition to the ones defined in ring.util.mime-type/default-mime-types

Middleware that adds a content-type header to the response if one is not
set by the handler. Uses the ring.util.mime-type/ext-mime-type function to
guess the content-type from the file extension in the URI. If no
content-type can be found, it defaults to 'application/octet-stream'.

Accepts the following options:

:mime-types - a map of filename extensions to mime-types that will be
              used in addition to the ones defined in
              ring.util.mime-type/default-mime-types
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close