Why does Rails render templates for HEAD requests? -


for head requests, rails seems perform usual steps including rendering templates , discards respective output (sends empty response).

i can't think of way rendering templates in case of head request makes sense (unless have actual business logic gets executed in templates, should never case).

so question be: agree me or there possible side-effects didn't foresee?

the reason i'm asking because i'm thinking of filing rails issue , possibly submit pull request feature disables default (non-explicit) template rendering head requests.

good point remo, however, not agree.

for every http verb, manually need write code handle things. similar thing head. head request follow execution style of request unless don't handle it.

an example can be:

def index   if request.head?     head :created   else     # handle request     rails.logger.info "derp #{request.method}"   end end 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -