You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Maxim Kuleshov <ku...@org.vrn.ru> on 2008/10/27 10:33:59 UTC

encoding in URI after form-based redirect

Hi!

Question refers to 5.5 branch (5.5.25 from ubuntu repos).

I use form-based authentication. If any protected URI containing
parameter value with non-ascii characters (%xx encoded of course)
is accessed before session starts, then after successful logon
request.getParameter() returns incorrectly interpreted value (as it was
in wrong encoding).

But subsequent GET to the same URI will result ok.

I use useBodyEncodingForURI=true mode in connector.

All content is UTF-8 encoded.

How could I fix of bypass such behaviour?

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: encoding in URI after form-based redirect

Posted by Maxim Kuleshov <ku...@org.vrn.ru>.
On Mon, 27 Oct 2008 08:36:03 -0500
"Caldarale, Charles R" <Ch...@unisys.com> wrote:

> > From: Maxim Kuleshov [mailto:kuleshov@org.vrn.ru]
> > Subject: encoding in URI after form-based redirect
> >
> > Question refers to 5.5 branch (5.5.25 from ubuntu repos).
> 
> If possible, try the problem URI with the latest 5.5 version from the
> Tomcat web site.
> 
> > I use useBodyEncodingForURI=true mode in connector.
> > All content is UTF-8 encoded.
> > How could I fix of bypass such behaviour?
> 
> Have you read the FAQ?
> http://wiki.apache.org/tomcat/FAQ/CharacterEncoding
> 

Thanks. I read about characterEncoding issue couple of years ago,
when had upgraded to 5.5 branch.

> Since everything should be UTF-8, have your tried setting the
> URIEncoding attribute to that in your <Connector> elements?  (You may
> want to remove the useBodyEncodingForURI when you do so.)

The problem is - not everything. There is at least one legacy
application written for cp1251.

I treat the problem as a bug, because exactly the same request
produces two different results, dependent on where page was redirected
from - form-based authenticator or anything else.

If setCharacterEncoding doesn't work by reason of
FormAuthenticator already accessed request content, when how I could
intercept it?

I've already tried custom FormAuthenticator valve config
(characterEncoding field, but it seems it only affects login and
password parameters).

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: encoding in URI after form-based redirect

Posted by Maxim Kuleshov <ku...@org.vrn.ru>.
On Mon, 27 Oct 2008 08:36:03 -0500
"Caldarale, Charles R" <Ch...@unisys.com> wrote:

> > From: Maxim Kuleshov [mailto:kuleshov@org.vrn.ru]
> > Subject: encoding in URI after form-based redirect
> >
> > Question refers to 5.5 branch (5.5.25 from ubuntu repos).
> 
> If possible, try the problem URI with the latest 5.5 version from the
> Tomcat web site.
> 

"Vanilla" 5.5.27 from apache.org has the same effect.

Moreover, URIEncoding does not help at all. First page execution
incorrectly interprets URI encoding. The second (i.e. after F5) works
fine.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: encoding in URI after form-based redirect

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Maxim Kuleshov [mailto:kuleshov@org.vrn.ru]
> Subject: encoding in URI after form-based redirect
>
> Question refers to 5.5 branch (5.5.25 from ubuntu repos).

If possible, try the problem URI with the latest 5.5 version from the Tomcat web site.

> I use useBodyEncodingForURI=true mode in connector.
> All content is UTF-8 encoded.
> How could I fix of bypass such behaviour?

Have you read the FAQ?
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

Since everything should be UTF-8, have your tried setting the URIEncoding attribute to that in your <Connector> elements?  (You may want to remove the useBodyEncodingForURI when you do so.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org