ring-clojure / ring-codec

Utility library for encoding and decoding data
MIT License
63 stars 30 forks source link

ring-core issue #312 can't use query parameters without a value #20

Closed pieter-van-prooijen closed 6 years ago

pieter-van-prooijen commented 6 years ago

This change allows the use query parameters without an accompanying "=" and value as used by some rest API's. The issue was actually reported in the ring core project, not on this utility lib.

weavejester commented 6 years ago

Thanks! Can you add a test for "a&b=c" and change the commit message so that it adheres to the seven rules?

pieter-van-prooijen commented 6 years ago

Hello James, I've updated the test and the commit message

weavejester commented 6 years ago

Perfect, thanks.

weavejester commented 6 years ago

Oh, well, maybe not quite perfect. The subject of the commit message is a little too long and should more accurately describe the change. So instead:

Change missing parameter values to empty strings

Query parameters that lack an an accompanying "=" clause should be
given a value of "" rather than nil to ensure type consistency and to
make the value truthy.

Fixes: ring-clojure/ring#312

Note that in GitHub we can refer to issues in other projects by appending the group and project name to the issue number, like so: ring-clojure/ring#312

pieter-van-prooijen commented 6 years ago

Didn't know about the project-name / issue number references, thanks ! I've updated the commit message as you suggested.

weavejester commented 6 years ago

Thanks for the PR!