ring-mock icon indicating copy to clipboard operation
ring-mock copied to clipboard

Make empty params to request give no query string

Open rutchkiwi opened this issue 2 months ago • 1 comments

The previous behaviour was to insert an empty query string for an empty map of params, but leave out the key in case it was nil. This change makes it consistently leave out the :query-string in both cases.

The previous behaviour caused problems when using the ring request/request-url function - it would (and still does as of time of writing) add a trailing ? to the url when the empty query string is there. This can be confusing.

Discussion: https://github.com/ring-clojure/ring/pull/543#issuecomment-3576166085

rutchkiwi avatar Nov 25 '25 16:11 rutchkiwi

Apologies for the kinda confusing commit message - I couldn't figure out how to phrase this better... Let me know if you think it makes sense, otherwise I can think of how to rephrase it.

rutchkiwi avatar Nov 25 '25 16:11 rutchkiwi