Hi David, adding cookies to a request via `.cookie...
# http4k
a
Hi David, adding cookies to a request via
.cookie(name, val)
results in the cookie values being surrounded by double-quotes. I'm guessing that is usually OK but is it possible to create the Cookie header without the double-quotes for some fussy servers? (other than creating my own list of k-v pairs and joining the string manually). Thanks
s
@andyg we don’t provide that option at the moment. We stuck with always adding quotes because it makes it safer to parse. What server are you having trouble with, btw? We could look into make it a bit more clever or make the quoting configurable. If you have an idea of the behaviour and would like to submit a PR for it we’re also happy to help getting it in
a
thanks, configurable seems best but I know most of the http4k code for adding or editing cookies are simple one-liners, don't want to add a lot of complexity. I will experiment with manual parsing to see if the server responds differently, there's a good chance quoted/unquoted has no effect. On this particular project, it's not a server I control so I can only experiment by modifying various aspects of the request.
d
I seem to remember that this was a problem with servers running .Net
As a workaround in the meantime you could add some custom extension methods to write the set-cookie header manually.
a
yep, I've been doing that so far. thanks!