8311: Fix "read" or "write" mistakenly appended to response data.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 14 Dec 2017 15:26:08 +0000 (10:26 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 14 Dec 2017 16:07:27 +0000 (11:07 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

services/arv-git-httpd/auth_handler.go

index db37ebb32677b76cf10ab1ddcd3ca4731e868e5c..e940c13ade06f91ba0d2a081f708a4af853a7b41 100644 (file)
@@ -70,7 +70,9 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
                        // Nobody has called WriteHeader yet: that
                        // must be our job.
                        w.WriteHeader(statusCode)
-                       w.Write([]byte(statusText))
+                       if statusCode >= 400 {
+                               w.Write([]byte(statusText))
+                       }
                }
 
                // If the given password is a valid token, log the first 10 characters of the token.