alvarcarto / alvarcarto/url-to-pdf-api

Empty string in cookie value 400s

Aperta
#139 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
HTML
Stelle
7.1k
Fork
779
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.