(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.
(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.
(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:
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.
An IllegalArgumentException is thrown if one or more segments are found.
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.(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |