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
Hi, I recently wanted to switch to http-kit over clj-http since it seems to have better performance, but I noticed handling cookies is tricky. The resulting :set-cookie header has all of the cookies concatenated with , but for example in a cookie's Expires field there can also be ,s so it makes it tricky to parse.
My suggestion is to instead concatenate multiple headers with \n instead so then the end user can easily split on \n to get the multiple values.
I was going to try to fork and make a PR but when I run lein test locally on the unchanged code I get 8 test fails. So I'm not sure about my setup.
The change I'm suggesting is java/org/httpkit/HttpUtils.java in the splitAndAddHeader method, line 378 replace the "," for "\n"
This then results in 3 new test failures that can be fixed by changing test/org/httpkit/client_test.clj tests: test-header-multiple-values and test-headers-stringified to use \n instead of , on lines 457, 458, and 465.
The text was updated successfully, but these errors were encountered:
Hi, I recently wanted to switch to
http-kit
overclj-http
since it seems to have better performance, but I noticed handling cookies is tricky. The resulting:set-cookie
header has all of the cookies concatenated with,
but for example in a cookie's Expires field there can also be,
s so it makes it tricky to parse.My suggestion is to instead concatenate multiple headers with
\n
instead so then the end user can easily split on\n
to get the multiple values.I was going to try to fork and make a PR but when I run
lein test
locally on the unchanged code I get 8 test fails. So I'm not sure about my setup.The change I'm suggesting is
java/org/httpkit/HttpUtils.java
in thesplitAndAddHeader
method, line 378 replace the","
for"\n"
This then results in 3 new test failures that can be fixed by changing
test/org/httpkit/client_test.clj
tests:test-header-multiple-values
andtest-headers-stringified
to use\n
instead of,
on lines 457, 458, and 465.The text was updated successfully, but these errors were encountered: