cowboy icon indicating copy to clipboard operation
cowboy copied to clipboard

match_qs crashes with badkey error

Open farhadi opened this issue 4 years ago • 1 comments

cowboy_req:match_qs for constraints given as {Key, Constraint} crashes with badkey error if key is missing. Expected behaviour is to crash with required error.

farhadi avatar Feb 13 '21 23:02 farhadi

Sounds good. Please add a test.

essen avatar Feb 14 '21 14:02 essen

Hello @essen @farhadi . Is this still an issue? Maybe I could continue and add the tests?

geeksilva97 avatar Jan 11 '24 12:01 geeksilva97

Yes feel free to add a test. Tickets that are not under the 2.11 milestone you can freely work on without problem.

essen avatar Jan 11 '24 12:01 essen

Yes feel free to add a test. Tickets that are not under the 2.11 milestone you can freely work on without problem.

sounds good

geeksilva97 avatar Jan 11 '24 13:01 geeksilva97

one last quesiton, @essen . Isse some references mentioning unit tests. I couldn't see where they are. Could you give me a clue?

This match_qs seems to be suitable for unit tests. There are some comments in the code saying that.

geeksilva97 avatar Jan 12 '24 01:01 geeksilva97

Unit tests are within the module of the function. But for this it should have a CT test.

essen avatar Jan 12 '24 08:01 essen

Companion PR got merged. I referenced the original author in the commit message. Closing, thanks!

essen avatar Jan 23 '24 13:01 essen