You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing an endpoint that is returning http Last-modified header, in the swagger Response headers box, instead of having them displayed raw as they are returned from the server, headers are lowercased (not an issue) and Last-modified is reformatted in a way that it no longer conforms to HTTP-date format (RFC2616)
Sending it in this format in If-Modified-Since header may then result in ignoring it as that's what http protocol tells to do (RFC7232).
To reproduce...
Nothing special:
Go to swagger-ui
Click on Try it out and Execute request returning Last-modified
Scroll down to Response headers
See how Last-modified is wrongly formatted
Expected behavior
Instead of Fri,20 Jul 2018 20:23:07 GMT, it should be Fri, 20 Jul 2018 20:23:07 GMT
Screenshots
Server response headers:
Swagger response headers box:
The text was updated successfully, but these errors were encountered:
tomeksamcik
changed the title
Last-modified response header date-time reformatted in Response headers box
Last-modified response header date-time wrongly formatted in Response headers box
Sep 9, 2022
This also happens with the Date and Expires response headers (and most likely other date response fields, if any) {"swaggerUI":{"version":"5.17.10","gitRevision":"gb5c84f44","gitDirty":true,"buildTimestamp":"Wed, 15 May 2024 14:13:17 GMT"}}
I was playing around with conditional requests and wasted a lot of time to figure this bug out because I copied the Last-Modified response header value into the If-Modified-Since input field and the server failed to parse the date and gave me HTTP 200 when I expected HTTP 304
It's not really about dates, but rather that the header value contains ", " (comma space)
Ex response:
Server: X-Header: A, B, C, D, , , , test, test
Swagger UI: x-header: A,B,C,D,,,,test, test
Q&A
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI is in it's default configuration.
Describe the bug you're encountering
When testing an endpoint that is returning http
Last-modified
header, in the swaggerResponse headers
box, instead of having them displayed raw as they are returned from the server, headers are lowercased (not an issue) andLast-modified
is reformatted in a way that it no longer conforms toHTTP-date
format (RFC2616)Sending it in this format in
If-Modified-Since
header may then result in ignoring it as that's what http protocol tells to do (RFC7232).To reproduce...
Nothing special:
swagger-ui
Try it out
andExecute
request returningLast-modified
Response headers
Last-modified
is wrongly formattedExpected behavior
Instead of
Fri,20 Jul 2018 20:23:07 GMT
, it should beFri, 20 Jul 2018 20:23:07 GMT
Screenshots
Server response headers:
Swagger response headers box:
The text was updated successfully, but these errors were encountered: