Just updated to pedestal 0.8.1 for one of my projects. Working well thank you. Observations: 1. I've raised an issue about io.pedestal/pedestal.error creating an anonymous interceptor - I thought it was one of mine but tracked it down to there. I'll try and raise a PR if I get change later today as it is a very easy fix. I used this as a chance to redo my error handling my using core.match directly myself, and I think it is easier to reason about than the macro. 2. Switching to the connector model worked really well. Feels more explicit. I used it as a reason to ditch my old use of default-interceptors to explicitly choosing what I wanted. 3. The change of case in the headers caught me out but luckily I had a test which picked up the issue. I've been through and checked all instances of "accept-language" to "Accept-Language" for example. Without the test, I might not have noticed this until production as it would just fail silently with broken behaviour.
Well, glad you are sorted out, and we'll both likely need to tweak things again a tad when 0.8.2 is released!
Well thank you because I'm not sure I would have noticed. I think response-for should lower-case any headers so it shouldn't matter what one uses....
For 3, I think this will be addressed in the next release probably? https://clojurians.slack.com/team/UE21H2HHD
Thanks. The link doesn't work, but I searched in the channel. I think that was a different issue and you said you needed to change to lowercase. In my example, I had to change from lower case to uppercase in my interceptor as the request headers are now in upper-case. Tricky, because http defines case-insensitive headers and http/2 defines them as lower case in dev tools (https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers). My changes are publicly visible in https://github.com/wardle/hermes/commit/44eeeb5e1ed368566f255c7a53d7fecdc221c934. Perhaps there should be an interceptor request-headers that 'normalises' the request headers to use lowercase keywords explicitly?
Oopsie. I think I linked to my Slack profile 😅 Correct link: https://clojurians.slack.com/archives/C0K65B20P/p1761670993386139 Yeah, I think you are right in that it is a different thing probably.
That's interesting. I have not changed that... and yet my tests work. https://github.com/wardle/hermes/blob/main/test/src/com/eldrix/hermes/server_test.clj
Now I'm confused. I'd better try with an independent tool like httpie and see what I get!
Ok you are right and I am wrong. When my test failed, I assumed the request headers were wrong because my debug code printed them out in uppercase! But that was during a test run using response-for. In a live test, using a proper running server, and 'httpie', it turns out that lowercase was correct in the context's request's headers. I 'fixed' the failing test by changing my interceptor, and not the test request.
So it is the same issue but I solved it 'wrong'!
That was part of the point of 0.8.1, the test layers should do what the production code does ... leave headers exactly as-is.