You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Cai, Charles [COMRES/RTC/RTC]" <Ch...@Emerson.com> on 2017/06/15 18:44:32 UTC
Tomcat URL encoding
Hi Guys,
Looking for help here after search on the web for couple hours:
I'm currently doing some testing on Tomcat 8.5.9 I'm trying to encode all the URL that is requesting to my server.
One thing I have noticed it wasn't working is the `\` (back slash) can't be allowed in the URL.
I'm getting the error saying:
INFO [https-jsse-nio-8443-exec-10] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
The test requesting URL is like this:
https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
Currenty, I tried those two approachs:
1st, set the server.xml with URIEncoding:
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
2nd, add the following filter:
https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
It should be like this after the encoding (replace `\` with `%5C` ) :
https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
but none of those options worked for me.
Thank you
Charles Cai
RE: Tomcat URL encoding
Posted by "Cai, Charles [COMRES/RTC/RTC]" <Ch...@Emerson.com>.
Sorry, I forgot mention, I already add the following to the catalina.properties file.
org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true
It didn't seems worked for me neither.
Charles Cai | T +1 440 329 4888
-----Original Message-----
From: Rossen Stoyanchev [mailto:rstoyanchev@pivotal.io]
Sent: Thursday, June 15, 2017 3:11 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Tomcat URL encoding
You need to enable this through the ALLOW_BACKSLASH property:
https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
On Thu, Jun 15, 2017 at 2:44 PM, Cai, Charles [COMRES/RTC/RTC] < Charles.Cai@emerson.com> wrote:
> Hi Guys,
>
> Looking for help here after search on the web for couple hours:
>
> I'm currently doing some testing on Tomcat 8.5.9 I'm trying to encode
> all the URL that is requesting to my server.
> One thing I have noticed it wasn't working is the `\` (back slash)
> can't be allowed in the URL.
>
> I'm getting the error saying:
> INFO [https-jsse-nio-8443-exec-10]
> org.apache.coyote.http11.Http11Processor.service
> Error parsing HTTP request header
> Note: further occurrences of HTTP header parsing errors will be
> logged at DEBUG level.
> java.lang.IllegalArgumentException: Invalid character found in the
> request target. The valid characters are defined in RFC 7230 and RFC
> 3986
>
> The test requesting URL is like this:
> https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
>
> Currenty, I tried those two approachs:
> 1st, set the server.xml with URIEncoding:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>
> 2nd, add the following filter:
> https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
>
> It should be like this after the encoding (replace `\` with `%5C` ) :
> https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
>
> but none of those options worked for me.
>
> Thank you
>
> Charles Cai
>
>
Re: Tomcat URL encoding
Posted by Rossen Stoyanchev <rs...@pivotal.io>.
You need to enable this through the ALLOW_BACKSLASH property:
https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
On Thu, Jun 15, 2017 at 2:44 PM, Cai, Charles [COMRES/RTC/RTC] <
Charles.Cai@emerson.com> wrote:
> Hi Guys,
>
> Looking for help here after search on the web for couple hours:
>
> I'm currently doing some testing on Tomcat 8.5.9 I'm trying to encode
> all the URL that is requesting to my server.
> One thing I have noticed it wasn't working is the `\` (back slash) can't
> be allowed in the URL.
>
> I'm getting the error saying:
> INFO [https-jsse-nio-8443-exec-10] org.apache.coyote.http11.Http11Processor.service
> Error parsing HTTP request header
> Note: further occurrences of HTTP header parsing errors will be logged at
> DEBUG level.
> java.lang.IllegalArgumentException: Invalid character found in the
> request target. The valid characters are defined in RFC 7230 and RFC 3986
>
> The test requesting URL is like this:
> https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
>
> Currenty, I tried those two approachs:
> 1st, set the server.xml with URIEncoding:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>
> 2nd, add the following filter:
> https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
>
> It should be like this after the encoding (replace `\` with `%5C` ) :
> https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
>
> but none of those options worked for me.
>
> Thank you
>
> Charles Cai
>
>
Re: Tomcat URL encoding
Posted by Mark Thomas <ma...@apache.org>.
On 15/06/2017 14:44, Cai, Charles [COMRES/RTC/RTC] wrote:
> Hi Guys,
>
> Looking for help here after search on the web for couple hours:
>
> I'm currently doing some testing on Tomcat 8.5.9 I'm trying to encode all the URL that is requesting to my server.
> One thing I have noticed it wasn't working is the `\` (back slash) can't be allowed in the URL.
>
> I'm getting the error saying:
> INFO [https-jsse-nio-8443-exec-10] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
> Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
> java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
>
> The test requesting URL is like this:
> https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
>
> Currenty, I tried those two approachs:
> 1st, set the server.xml with URIEncoding:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>
> 2nd, add the following filter:
> https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
>
> It should be like this after the encoding (replace `\` with `%5C` ) :
> https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
>
> but none of those options worked for me.
It needs to be encoded on the client.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org