History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: STS-315
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Ben Gunter
Reporter: Renaud Bruyeron
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Stripes

MockHttpServletRequest.addHeader and getHeader do not work with upper-case header names

Created: 01/Dec/06 07:33 AM   Updated: 30/Apr/07 05:32 AM
Component/s: None
Affects Version/s: Release 1.5 , Release 1.4.2
Fix Version/s: Release 1.4.3

File Attachments: 1. Text File patch.txt (2 kb)



 Description  « Hide
addHeader(name, value) calls toLowerCase() before saving the header in the Set, but getHeader(name) does not check if the supplied parameter is lowercase or not.

The patch supplied provides both the unittest and the fix.

 All   Comments   Change History      Sort Order:
Renaud Bruyeron [01/Dec/06 07:35 AM]

Provides a simple test case that shows that if you do MockHttpServletRequest.addHeader("User-Agent", "something") then getHeader("User-Agent") returns null.

The fix simply tries again after toLowerCase() if the first attempt returns null.

Ben Gunter [03/Mar/07 09:11 PM]
I opted to just convert the header name to lower-case before looking it up. The patch for the test class was applied as-is.