Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When adding a GET request handler, add one for HEAD as well. #44

Closed
wants to merge 1 commit into from

Conversation

muja
Copy link

@muja muja commented Apr 5, 2015

I think it is common for servers to automatically implement a HEAD method based on the GET.

@unknwon
Copy link
Contributor

unknwon commented Jun 11, 2015

Hi, thanks for your PR and sorry for being late! Your idea sounds good, but what about an option for this?

Sample code:

m.Get()   // this one will not add HEAD method
m.AutoHead = true
m.Get()... // this one does

How do you think? 💫

unknwon added a commit that referenced this pull request Jun 21, 2015
@unknwon
Copy link
Contributor

unknwon commented Jun 21, 2015

Hi, I've pushed code to master that uses similar but not exact way as I posted above, but you can see very simple sample from test case here: https://github.com/Unknwon/macaron/blob/c1f25f761f9d44f213f64dd3cb03a8e9ba839163/router_test.go#L123-L133

Thank you again!

@unknwon unknwon closed this Jun 21, 2015
unknwon added a commit that referenced this pull request Sep 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants