Sorry if this is not the case.
As defined by http: http://tools.ietf.org/html/rfc7232#section-3.3
The receiver MUST ignore the If-Modified-Since header field if the received field value is not a valid HTTP date, or if the request method is neither GET nor HEAD.
Spring Boot does not do this. It throws an IllegalArgumentException, which is not handled by code that checks the value of the header.
Here is the conversion code in org.springframework.http.HttpHeaders.java
public long getIfModifiedSince() { return getFirstDate(IF_MODIFIED_SINCE); } public long getFirstDate(String headerName) { String headerValue = getFirst(headerName); if (headerValue == null) { return -1; } for (String dateFormat : DATE_FORMATS) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat, Locale.US); simpleDateFormat.setTimeZone(GMT); try { return simpleDateFormat.parse(headerValue).getTime(); } catch (ParseException ex) {
So, if you send the If-Modified-Since: 0 header, you will get an exception instead of returning a new GET response as defined in the http specification.
Does anyone else see this as a problem?
micko source share