Page MenuHomePhabricator

Handle HEAD requests
Closed, ResolvedPublic

Description

Currently, RESTBase does not handle HEAD requests at all - it just throws a 404 as no route has got a HEAD handler defined. For an incoming HEAD request, we need to:

  • find either a HEAD or a GET handler for the route, error out otherwise
  • complete the request, and, if the GET handler was used truncate the body and remove the Content-Length header

Additionally, we need to truncate the body and remove the Content-Length header for all outgoing responses (even errors) for HEAD requests.

Event Timeline

mobrovac raised the priority of this task from to Low.
mobrovac updated the task description. (Show Details)
mobrovac subscribed.

A PR for this issue is available here: https://github.com/wikimedia/restbase/pull/304
It's been merged, so this can be closed once new RB version is deployed

This code is now in production, so the issue could be closed

Pchelolo set Security to None.