MockHttpServletRequest.getIntHeader() should return -1 when item does not exist

Description

According to servlet specification, ServletRequest.getIntHeader() should return -1 when the header in question does not exist. Stripes instead throws a NullPointerException...

Fix is easy:

1 2 3 4 5 /** Gets the named header as an int. Must have been set as an Integer with addHeader(). */ public int getIntHeader(String name) { if( !this.headers.containsKey(name) ) return -1; return (Integer) this.headers.get(name); }

Environment

None

Status

Assignee

Rick G

Reporter

"Failed to Retrieve User "

Labels

None

Tester

None

Fix versions

Affects versions

Release 1.5.7

Priority

Major
Configure