Discussion:
[Stripes-dev] [JIRA] Created: (STS-919) MockHttpServletRequest.getIntHeader() should return -1 when item does not exist
Janne Jalkanen (JIRA)
11 years ago
Permalink
MockHttpServletRequest.getIntHeader() should return -1 when item does not exist
-------------------------------------------------------------------------------

Key: STS-919
URL: http://www.stripesframework.org/jira/browse/STS-919
Project: Stripes
Issue Type: Bug
Affects Versions: Release 1.5.7
Reporter: Janne Jalkanen


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:

{code}
/** 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);
}
{code}
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Remi VANKEISBELCK (JIRA)
11 years ago
Permalink
[ http://www.stripesframework.org/jira/browse/STS-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13090#comment-13090 ]

Remi VANKEISBELCK commented on STS-919:
---------------------------------------

Could you please create a Pull Request in github ?
...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Janne Jalkanen (JIRA)
11 years ago
Permalink
[ http://www.stripesframework.org/jira/browse/STS-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13091#comment-13091 ]

Janne Jalkanen commented on STS-919:
------------------------------------

Can do - I did not realize that Stripes is now on Github.
...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Loading...