tower-web icon indicating copy to clipboard operation
tower-web copied to clipboard

Add support for HEAD method – #[head("/")]

Open manifest opened this issue 7 years ago • 2 comments

It is currently impossible to define a handler for HEAD method.

impl MyApp {
    #[head("/")]
    fn index(&self) -> Result<String, ()> {
    // implementation
    }
}

manifest avatar Sep 01 '18 11:09 manifest

Additionally, HEAD requests should probably match GET as well.

carllerche avatar Sep 04 '18 19:09 carllerche

Could you please elaborate on how you see this working? Both methods definitely work with the same resource but responses are different, so should be handlers.

manifest avatar Sep 05 '18 06:09 manifest