url-to-pdf-api icon indicating copy to clipboard operation
url-to-pdf-api copied to clipboard

Empty string in cookie value 400s

Open joshjung opened this issue 4 years ago • 1 comments

Just discovered that if you provide an empty string value for a cookie during a POST the server errors and says:

2020-08-10T13:19:43.083Z - warn: [error-logger.js] {"status":400,"statusText":"Bad Request","errors":[{"field":[],"location":"body","messages":["\"value\" must be a string"],"types":["string.base"]},{"field":["cookies}

This error is incredibly vague and also incorrect. For some reason an empty string is being interpreted as undefined and/or null. Took me a while to realize that if value is '' then we need to remove the cookie from the POST.

joshjung avatar Aug 10 '20 13:08 joshjung

I also bumped into this same error, however for me it was a miss configured/typo in the JSON. Very miss-leading and time consuming to debug.

JustinShift avatar Oct 19 '22 16:10 JustinShift