-
Notifications
You must be signed in to change notification settings - Fork 425
Description
Only a subset of HTTP status codes is supported by the server. Looking at:
it appears that only few possible status lines are baked into the function that produces the buffer for this part of the response. The status_type enumeration itself contains all the standard status codes but in many cases that switch-case in the aforementioned function just defaults to 500 Internal Server Error.
I'm currently designing a REST API and as part of my optimistic concurrency control mechanism would like to return either 409 Conflict or 412 Precondition Failed in case the client tries to make updates to stale data. I don't think this is that unusual but currently it's not possible with the server. I've fixed this for myself in my fork:
Also, it seems suspicious that the version of the protocol is hard-coded into the status line constants. Should this not reflect the version the client actually requests? In my version I'm consistently using 1.1.