Skip to content

Commit cba58ea

Browse files
committed
Fix isValidHeader function
1 parent 19478e8 commit cba58ea

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

config/config.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,11 @@ func SetUpLocations() error {
6363

6464
func isValidHeader(r *http.Response) bool {
6565
contentType := r.Header.Get("Content-Type")
66-
if !strings.HasPrefix(contentType, "text/html") {
67-
return false
68-
}
69-
return true
66+
return strings.HasPrefix(contentType, "text/html")
7067
}
7168

7269
func modifyResponse(r *http.Response) error {
73-
if isValidHeader(r) {
70+
if !isValidHeader(r) {
7471
err := errors.New("Unexpected Content-Type")
7572
logger.Error(err)
7673
return err

0 commit comments

Comments
 (0)