Description
Use of the 100 (Continue) Status (https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3):
The purpose of the 100 (Continue) status (see section 10.1.1) is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body. In some cases, it might either be inappropriate or highly inefficient for the client to send the body if the server will reject the message without looking at the body.
In my case, for example, I can upload file or reject already uploaded file in one atomic request.
Current state:
- 0.9.x - handler can make desigion and allow/reject client request by additional
check_continue
method. This method is not supported by https://github.com/iron/iron and https://github.com/nickel-org/nickel.rs. Also this method require duplicate logic (it not called on HTTP/1.0) for routing and check permissions; - master - looks like this feature is forgotten.
I think, much better to send "100 Continue" status on first Body::read() call (similar logic implemented by https://github.com/frewsxcv/tiny-http project).
In this case no additional logic/callback needed for make desigion about "100 Continue":
- If you call Body::read() method, then you needs to request body and hyper send to client "100 Continue";
- If you have anought information to send final status without body, then hyper send status without "100 Continue".
I try to change logic on 0.9.x branch by send "100 Continue" status of first read call, but I failed :(