pedestal

Mark Wardle 2025-11-17T19:09:32.181799Z

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.

lread 2025-11-18T16:43:12.131999Z

Well, glad you are sorted out, and we'll both likely need to tweak things again a tad when 0.8.2 is released!

Mark Wardle 2025-11-18T16:44:59.562139Z

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....

lread 2025-11-17T19:25:28.450019Z

For 3, I think this will be addressed in the next release probably? https://clojurians.slack.com/team/UE21H2HHD

Mark Wardle 2025-11-17T19:46:54.463519Z

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?

lread 2025-11-17T19:51:41.524799Z

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.

Mark Wardle 2025-11-17T19:54:00.439689Z

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

Mark Wardle 2025-11-17T19:54:18.288379Z

Now I'm confused. I'd better try with an independent tool like httpie and see what I get!

Mark Wardle 2025-11-17T20:01:22.590779Z

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.

Mark Wardle 2025-11-17T20:01:58.222959Z

So it is the same issue but I solved it 'wrong'!

hlship 2025-11-20T16:37:49.366259Z

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.