You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by "LAU,MARVIN (HP-Philadelphia,ex1)" <ma...@hp.com> on 2001/04/22 13:10:01 UTC

[PATCH] Typo in DefaultTurbineRunData.java

Hi,

There is a typo in the getUserAgent method of
org.apache.turbine.services.rundata.DefaultTurbineRunData.  The string
"User-agent" should be "User-Agent" (with a capital "A").  This bug causes
servlet engines that perform case sensitive comparison to return null
instead
of the user agent string.  The following patch fixes this problem.

Thanks,
Marvin
----------------------------------------------------------------------------
--

Index: DefaultTurbineRunData.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/rundata
/DefaultTurbineRunData.java,v
retrieving revision 1.7
diff -r1.7 DefaultTurbineRunData.java
1309c1309
<             this.userAgent = this.getRequest().getHeader( "User-agent" );
---
>             this.userAgent = this.getRequest().getHeader( "User-Agent" );

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


RE: [PATCH] Typo in DefaultTurbineRunData.java

Posted by Ilkka Priha <ip...@surfeu.fi>.
Actually, it's your servlet engine that has a bug:

RFC2068
-------

4.2 Message Headers

   HTTP header fields, which include general-header (section 4.5),
   request-header (section 5.3), response-header (section 6.2), and
   entity-header (section 7.1) fields, follow the same generic format as
   that given in Section 3.1 of RFC 822 [9]. Each header field consists
   of a name followed by a colon (":") and the field value. Field names
   are case-insensitive.

Anyway, as User-Agent is the spelling used in the RFC I added the patch to
CVS. Thanks.

-- Ilkka


> -----Original Message-----
> From: LAU,MARVIN (HP-Philadelphia,ex1) [mailto:marvin_lau@hp.com]
> Sent: Sunday, April 22, 2001 14:10
> To: 'turbine-dev@jakarta.apache.org'
> Subject: [PATCH] Typo in DefaultTurbineRunData.java
>
>
> Hi,
>
> There is a typo in the getUserAgent method of
> org.apache.turbine.services.rundata.DefaultTurbineRunData.  The string
> "User-agent" should be "User-Agent" (with a capital "A").  This bug causes
> servlet engines that perform case sensitive comparison to return null
> instead
> of the user agent string.  The following patch fixes this problem.
>
> Thanks,
> Marvin
> ------------------------------------------------------------------
> ----------
> --
>
> Index: DefaultTurbineRunData.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/servic
> es/rundata
> /DefaultTurbineRunData.java,v
> retrieving revision 1.7
> diff -r1.7 DefaultTurbineRunData.java
> 1309c1309
> <             this.userAgent =
s.getRequest().getHeader( 
> "User-agent" );
> ---
> >             this.userAgent = this.getRequest().getHeader( 
> "User-Agent" );
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org