Liking cljdoc? Tell your friends :D

puppetlabs.trapperkeeper.services.webserver.normalized-uri-helpers


add-normalized-uri-filter-to-servlet-handler!clj

(add-normalized-uri-filter-to-servlet-handler! handler)

Inputs: [handler :- ServletContextHandler]

Adds a servlet filter to the servlet handler which provides a normalized request URI on to its downstream consumers for an incoming request.

Inputs: [handler :- ServletContextHandler]

Adds a servlet filter to the servlet handler which provides a normalized
request URI on to its downstream consumers for an incoming request.
sourceraw docstring

maybe-add-normalized-uri-filter!clj

(maybe-add-normalized-uri-filter! handler normalize-request-uri?)

Inputs: [handler :- ServletContextHandler normalize-request-uri? :- schema/Bool]

If normalize-request-uri? is true, adds a URI normalization filter to the given ServletContextHandler.

Inputs: [handler :- ServletContextHandler normalize-request-uri? :- schema/Bool]

If normalize-request-uri? is true, adds a URI normalization filter to
the given ServletContextHandler.
sourceraw docstring

normalize-uri-pathclj

(normalize-uri-path request)

Inputs: [request :- HttpServletRequest] Returns: schema/Str

Return a 'normalized' version of the uri path represented on the incoming request. The 'normalization' consists of three steps:

  1. URL (percent) decode the path, assuming any percent-encodings represent UTF-8 characters.

An exception may be thrown if the request has malformed content, e.g., partially-formed percent-encoded characters like '%A%B'.

If a semicolon character, U+003B, is found during the decoding process, it and any following characters will be removed from the decoded path.

  1. Check the percent-decoded path for any relative path segments ('..' or '.').

An IllegalArgumentException is thrown if one or more segments are found.

  1. Compact any repeated forward slash characters in a path.
Inputs: [request :- HttpServletRequest]
Returns: schema/Str

Return a 'normalized' version of the uri path represented on the incoming
request.  The 'normalization' consists of three steps:

1) URL (percent) decode the path, assuming any percent-encodings represent
   UTF-8 characters.

 An exception may be thrown if the request has malformed content, e.g.,
 partially-formed percent-encoded characters like '%A%B'.

 If a semicolon character, U+003B, is found during the decoding process, it
 and any following characters will be removed from the decoded path.

2) Check the percent-decoded path for any relative path segments ('..' or
   '.').

 An IllegalArgumentException is thrown if one or more segments are found.

3) Compact any repeated forward slash characters in a path.
sourceraw docstring

normalized-uri-filterclj

(normalized-uri-filter)

Inputs: [] Returns: Filter

Create a servlet filter which provides a normalized request URI on to its downstream consumers for an incoming request. The normalized URI would be returned for a 'getRequestURI' call on the HttpServletRequest parameter. Normalization is done per the rules described in the normalize-uri-path function. If an error is encountered during request URI normalization, an HTTP 400 (Bad Request) response is returned rather than the request being passed on its downstream consumers.

Inputs: []
Returns: Filter

Create a servlet filter which provides a normalized request URI on to its
downstream consumers for an incoming request.  The normalized URI would be
returned for a 'getRequestURI' call on the HttpServletRequest parameter.
Normalization is done per the rules described in the `normalize-uri-path`
function.  If an error is encountered during request URI normalization, an
HTTP 400 (Bad Request) response is returned rather than the request being
passed on its downstream consumers.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close