Fork me on GitHub
#yada
<
2019-02-08
>
mjmeintjes10:02:42

I'm struggling to get a basic POST handler working. It seems that my content-type header does not include a charset, which means that

(codec/form-decode
                    body-string
                    (req/character-encoding (:request ctx)))
returns {nil nil}. I fixed this by creating an interceptor that adds ";charset=utf-8" to the content-type (`(update-in ctx [:request :headers "content-type"] str ";charset=utf-8")`), but this can't be the right way to do it. What am I missing?

malcolmsparks10:02:22

What version of yada? I ask because I hit the same issue myself recently and made the charset default to the platform charset.

malcolmsparks10:02:45

My fix is released, it was fairly simple.

mjmeintjes10:02:39

yada {:mvn/version"1.2.16"}

mjmeintjes10:02:37

The problem seems to be that if (req/character-encoding (:request ctx)) returns nil, then the form-decode fails.

malcolmsparks11:02:11

It's fixed in 1.3.0. Your interceptor approach is a valid workaround for the time being

borkdude12:02:44

I have an issue with a route that expects part of the PATH to have an url-encoded slash which should not be treated as separate fragments:



Should that work, or maybe I should organize it differently

borkdude12:02:15

the last two fragments are IDS which I cannot guarantee they will never have a slash