[BUG][Java][jersey2] Date header should be in GMT format, but it has timezone information
Created by: sebastien-rosset
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
The java jersey2 library is incorrectly setting the Date
header. The date format should be compliant with RFC 7231, which states the time must be set to GMT.
According to RFC 7231, the "Date" header field represents the date and time at which the message was originated. The field value is an HTTP-date, as defined in Section 7.1.1.1. The preferred format is a fixed-length and single-zone subset of the date and time specification used by the Internet Message Format.
IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
For example, the jersey2 library sets the Date
header to Mon, 13 Jul 2020 09:47:14 PDT
.
Expected Output: Mon, 13 Jul 2020 17:47:14 GMT
Instead, getting: Mon, 13 Jul 2020 09:47:14 PDT
The date format is set to RFC3339 by default in the generated ApiClient.java. This is the right default value for serialized dates in the HTTP body, but the Date
header should be compliant with RFC 7231 format, which is RFC1123.
openapi-generator version
master July 13 2020
OpenAPI declaration file content or url
There is no applicable OpenAPI document. This is a problem setting the value of the Date
HTTP header.