Skip to content

Spring - webRequest.checkNotModified(...) not working #122

@andregrund

Description

@andregrund
  • Framework version: 0.9.1
  • Implementations: Spring

Scenario

I want to use HTTP 1.1 header "If-Modified-Since". When sending a request with that header "If-Unmodified-Since" is checked first, see org.springframework.web.context.request.ServletWebRequest#checkNotModified(String s, long l). This calls com.amazonaws.serverless.proxy.internal.servlet.AwsProxyHttpServletRequest#getDateHeader(String s). If the header is not set (null), a new Date().getTime() is returned which I think is not correct.

Expected behavior

As stated in the documentation I expect a 304 HTTP status code when using webRequest.checkNotModified(long l) and no modification has been made. To archive this, getDateHeader(String s) should return -1L in case a header has not been set.

Actual behavior

org.springframework.web.context.request.ServletWerRequest#validateIfUnmodifiedSince(long l) expects -1L in case no modification has been made. This should also be returned if no header has been set at all.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions