yada icon indicating copy to clipboard operation
yada copied to clipboard

yada throws exception when media-type is not parsable

Open stijnopheide opened this issue 10 years ago • 3 comments

When a client sends an invalid Accept header e.g. 'Accept: application/json, text/plain, /', yada.media-type/string->media-type will throw an exception, resulting in a 500 response.

This should be 400 Bad Request.

stijnopheide avatar Nov 11 '15 12:11 stijnopheide

I agree. There's a few of these cases I'm looking at now, like #54

malcolmsparks avatar Feb 04 '16 22:02 malcolmsparks

I just came across this as well, looks like it should check that g is not empty in yada.media-type line 34. Should it throw an error if it's not parsable or just ignore it?

shmish111 avatar Jun 13 '16 15:06 shmish111

I think it should be a 400 ideally. I'm aware of it - I did try to fix it the other day but it was a little more tricky than I had time for.

malcolmsparks avatar Jun 13 '16 16:06 malcolmsparks