tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: mod_jk codepage in header values
Date Thu, 21 Jan 2010 15:34:22 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mirko,

On 1/21/2010 6:43 AM, Mirko Solic wrote:
> That what i'm afraid of. This code: new
>  String(request.getHeader(headerName).getBytes("ISO-8859-1")) works for
> now but it really shouldn't work.
> That way i'm searching for more legitimate way.

What would be better is to do something like this:

java.net.URLEncoder.encode(request.getHeader(headerName), "UTF-8")

Of course, this will only work if your client knows that's how the
encoding will be done.

> From Idp (AAI identity provider) i get user data and SP (AAI service
> provide, this is module in apache) put this data in apache environment
> variables with utf-8 values. Then as i understand mod_jk take this
> variables and pack them in http header. I would like to have environment
> variables on apache with utf-8 values so applications (e.g php web
> pages) that are on this apache would still work.

AAI needs to support whatever encoding you intend to use. You can't
simply transcode things in an arbitrary way and expect AAI to work
properly. What does their documentation say about what format these
values should take?

> AAI returns more then just user-id. Idea behind AAI is that application
> save as little as possible data about user. All data is provided by AAI.
> In this data is for example first-name, last-name, address, .... It
> would be perfect that we would have this SP running on tomcat and we
> wouldn't need apache but at the time there is no such SP.

A better strategy would be for AAI to provide a numeric token (easily
passable in HTTP headers without any encoding issues) and then provide
an HTTP-based and/or XML-based API that uses proper document encoding to
send textual data across the wire.

Using HTTP headers for text data sucks!

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktYc/4ACgkQ9CaO5/Lv0PDtNwCeJzVwiPNpMCOXYTCHYa87pqXs
f9IAoJiyaTh0lbiMnxwG7Bp9/jWnHeMV
=fHrt
-----END PGP SIGNATURE-----

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


Mime
View raw message