This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 30624

Summary: MON: Headers with multiple values not recorded properly
Product: javaee Reporter: Jason Rush <jrush>
Component: HTTP MonitorAssignee: Ana.von Klopp <avk>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P4    
Version: -FFJ-   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jason Rush 2003-02-04 01:27:24 UTC
Description: 
Build 020107.

A request may contain the same header with multiple values.  Currently when 
this occurs, Monitor records one entry for each appearance of the header, but 
both entries have the first value.  We should record all values for the header.

For example, if the following request is made:

GET /foo.jsp HTTP/1.0
Cookie: foo1=bar1
Cookie: foo2=bar2

Then what should be recorded by Monitor for the HTTP headers would be:

Cookie    foo1=bar1
Cookie    foo2=bar2

Suggested Fix: 
This is probably caused by calling HttpServletRequest's getHeader(name) method 
instead of getHeaders(name).  The getHeader method will return only the first 
value for the header name, but getHeaders will return an Enumeration with all 
of the values associated with that header name.  However, you should only call 
getHeaders for the first occurence of the header name ... multiple calls would 
be redundant.
A comment.
Comment 1 Ana.von Klopp 2003-02-04 02:25:46 UTC
See suggested fix above.
Comment 2 Ana.von Klopp 2003-02-19 20:12:55 UTC
I forgot to mark this as fixed when I fixed the duplicate 
headers issue. 
Comment 3 Jason Rush 2003-08-10 23:23:57 UTC
Verified in release 3.5.1.