httpd: add support for route undefined HEAD requests to GET handlers

HEAD responses will not include a body but the Content-Length will be
set as the equivalent GET request

Fixes #255
This commit is contained in:
Nicola Murino
2020-12-20 10:22:16 +01:00
parent 1ac610da1a
commit 743b350fdd
2 changed files with 3 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ import (
func initializeRouter(enableProfiler bool) {
router = chi.NewRouter()
router.Use(middleware.GetHead)
router.Use(middleware.Recoverer)
router.Group(func(r chi.Router) {