Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4512200
Votes 0
Synopsis HTTP header "User-Agent" format incorrect
Category java:classes_net
Reported Against 1.3
Release Fixed 1.4.1(hopper)
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs
Submit Date 09-OCT-2001
Description




java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

The User-Agent header received by the server is "Java1.3.0".  this string is
not in compliance with RFC 2616 ("HTTP/1.1"), section 3.8 ("Product Tokens"):
product         = token ["/" product-version]
product-version = token

according to the spec is should be "Java/1.3.0" or something similar where the
version is separated from the product by a '/'.
(Review ID: 133354) 
======================================================================
Work Around




via the system property "http.agent" the User-Agent can be specified, though
only once - it can not be altered once it has been read into into a static
final String within HttpURLConnection.
======================================================================
Evaluation
Seems like a reasonable suggestion. It is also arguable
that the http.agent property should not
override the default string, but should instead be placed
before the default string. Setting the property to FooApp/1.0
might result in the following:

User-Agent: FooApp/1.0 Java/1.4.1

Will revisit for 1.4.1

  xxxxx@xxxxx   2001-10-09
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang