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 - MON: Headers with multiple values not recorded properly
Summary: MON: Headers with multiple values not recorded properly
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: HTTP Monitor (show other bugs)
Version: -FFJ-
Hardware: All All
: P4 blocker (vote)
Assignee: Ana.von Klopp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-04 01:27 UTC by Jason Rush
Modified: 2003-08-10 23:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.