serve HEAD requests via the fileserver (#735)

This commit is contained in:
tobi 2022-07-30 14:42:47 +02:00 committed by GitHub
commit 8fdc9ed552
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 7 deletions

View file

@ -59,5 +59,6 @@ func (m *FileServer) Route(s router.Router) error {
// something like "/fileserver/:account_id/:media_type/:media_size/:file_name"
fileServePath := fmt.Sprintf("%s/:%s/:%s/:%s/:%s", FileServeBasePath, AccountIDKey, MediaTypeKey, MediaSizeKey, FileNameKey)
s.AttachHandler(http.MethodGet, fileServePath, m.ServeFile)
s.AttachHandler(http.MethodHead, fileServePath, m.ServeFile)
return nil
}