tomaka / rouille

Web framework in Rust
Apache License 2.0
1.09k stars 105 forks source link

Add Response::empty_204 #174

Closed jhoekx closed 6 years ago

jhoekx commented 6 years ago

I wanted to return status code 204 No Content. There are helpers for empty errors, but not for OK responses. This adds a helper for 204.

I noticed that people are using ugly workarounds like:

Response::empty_404().with_status_code(204).without_header("Content-Length")

(from https://github.com/tomaka/rouille/issues/150 )

If you want I would be willing to refactor the different empty_* functions to use a common private function.

tomaka commented 6 years ago

Thanks!

If you want I would be willing to refactor the different empty_* functions to use a common private function.

That's not necessary I think.