tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Request headers created in valve don't make it to application
Date Wed, 01 Jun 2011 14:22:25 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marc,

On 5/31/2011 5:27 PM, Marc Boorshtein wrote:
>> 2) Show us your Valve code.  (It is simple, right?)
> 
> Iterator<Attribute> attribs = lastmile.getAttributes().iterator();
> 				while (attribs.hasNext()) {
> 					Attribute attrib = attribs.next();
> 						if (this.createHeaders) {
> 							logger.info("creating header");
> 						for (String val : attrib.getValues()) {
> 							logger.info(attrib.getName() + "=" + val);
> 							request.addHeader(attrib.getName(), val);
> 						}
> 					}

Can you try this:

    request.addHeader(attrib.getName(), val);

    logger.info("After added header: "
              + attrib.getName() + "="
              + request.getHeader(attrib.getName()));

I wonder if the header value is being ignored because the request is
frozen or something like that.

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

iEYEARECAAYFAk3mSyEACgkQ9CaO5/Lv0PD/AACfZg+IWAsUhL6Rrh0BkqQTaqLO
tKkAoKK0YfmIIBqMY78ZTWnSQJg44mWY
=c/1M
-----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