tests for http package

This commit is contained in:
Julien Neuhart
2018-04-04 18:10:18 +02:00
parent 3d8247ec50
commit 15916e80e6
2 changed files with 43 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ func (e *notAuthorizedContentTypeError) Error() string {
// FindAuthorizedContentType tries to return a content type according to a request header.
// If no authorized content type found, throws an error.
func FindAuthorizedContentType(h http.Header) (ContentType, error) {
ct := findContentType(h.Get("Content-Type"), HTMLContentType, OctetStreamContentType, MultipartFormDataContentType)
ct := findContentType(h.Get("Content-Type"), OctetStreamContentType, MultipartFormDataContentType)
if ct == "" {
return "", &notAuthorizedContentTypeError{}
}