Closed opqdonut closed 1 week ago
Yes, but in this case the error is with the spec, not the middleware. It looks like when I was converting the spec to markdown a mistake was made.
Thanks for the spot, I'll go ahead and fix it.
To clarify further, I converted the current markdown-based spec from work I was doing on Ring 2.0. My original plan for 2.0 was to make the response headers consistently lowercase to make them easier to access by middleware. However, this would be a breaking change from the 1.x specs.
I eventually abandoned the work on Ring 2.0, as the breaking changes I wanted weren't enough to justify running two separate specs, or trying to make Ring work with both. I may return to it in future at some point.
According to the spec, the keys in the headers map should be lowercased.
https://github.com/ring-clojure/ring/blob/master/SPEC.md#headers-1
At least the ring.util.response/content-type util produces a mixed-case header,
"Content-Type"
. Probably other utils do the same.https://github.com/ring-clojure/ring/blob/f7dfe7c9b98c335e4573e61d94c523d5df9a6667/ring-core/src/ring/util/response.clj#L184
We discovered this while looking into metosin/ring-http-response#35 .
Would a PR be welcome?