[undertow-dev] Disable URL decoding when rewriting

Stuart Douglas sdouglas at redhat.com
Sun Dec 10 19:54:19 EST 2017


Rewrite should not affect the encoding, except for query parameters
referenced through
io.undertow.server.HttpServerExchange#getQueryParameters() which are
always decoded.

Are you sure this is related to the rewrite? In general Undertow will
decode all URI's to UTF-8 by default. If you want your app to handle
all the encoding yourself you can set
io.undertow.UndertowOptions#DECODE_URL to false, which will prevent
Undertow from doing any decoding.

This does have some drawbacks though, mostly that it is a global
setting that affects all applications.

Stuart

On Fri, Dec 8, 2017 at 6:48 PM, Lukas Lentner <kontakt at lukaslentner.de> wrote:
> Hi,
>
>
>
> I am using Wildfly 10.1.0.final which means undertow 1.4.0.final and I have
> the following problem. I configured my app with
>
>
>
> WEB-INF/undertow-handlers.conf :
>
> path-prefix('/application') -> rewrite('${remaining}')
>
>
>
> This works pretty well, but when the rewrite is triggered it seems to once
> decode my URL. This is bad as my app will do the decoding at a central place
> once and thus the url will be decoded twice if the endpoint is called via
> /application/…
>
>
>
> How can I circumvent that undertow decodes my url before rewriting?
>
>
>
> Thankx
>
> Lukas
>
>
>
>
>
> ----
>
>
>
> Lukas Lentner, B. Sc.
>
>
>
> St.-Cajetan-Straße 13
>
> 81669 München
>
> Deutschland
>
>
>
> Fon:     +49 / 89  / 44 38 61 27
>
> Mobile:  +49 / 176 / 24 77 09 22
>
>
>
> E-Mail:  Kontakt at LukasLentner.de
>
> Website: www.LukasLentner.de
>
>
>
> IBAN:    DE33 7019 0000 0001 1810 17
>
> BIC:     GENODEF1M01 (Münchner Bank)
>
>



More information about the undertow-dev mailing list