add support for HEAD requests

This patch adds support for HEAD requests.