You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While writing some tests for my library, I stumbled upon another minor inconsistency: trying to retrieve a non-existent post will always return a response in text/plain, whether authenticated or not.
Reproduction:
❯ curl -i http://localhost:8080/api/posts/0 -H "content-type: application/json"
HTTP/1.1 404 Not Found
Cache-Control: public, max-age=604800, immutable
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Thu, 09 Nov 2023 18:19:02 GMT
Content-Length: 19
404 page not found
Same thing happens when I try to post an update, or delete a non-existing post: the response is in text/plain. Looks like the entire /api/posts/{id} endpoint returns text/plain when the id doesn't exist, rather than the usual json.
The text was updated successfully, but these errors were encountered:
Since the ID for /api/posts/0 is only one character, WF falls back to the default handlers. There's no reason we need to be so strict, so we can probably just remove the regex here.
While writing some tests for my library, I stumbled upon another minor inconsistency: trying to retrieve a non-existent post will always return a response in
text/plain
, whether authenticated or not.Reproduction:
Same thing happens when I try to post an update, or delete a non-existing post: the response is in text/plain. Looks like the entire
/api/posts/{id}
endpoint returns text/plain when the id doesn't exist, rather than the usual json.The text was updated successfully, but these errors were encountered: