diff --git a/server/go/auth/auth.go b/server/go/auth/auth.go index 472164394..5711d539d 100644 --- a/server/go/auth/auth.go +++ b/server/go/auth/auth.go @@ -42,6 +42,7 @@ func IsAuthorized(req *http.Request) bool { func RequireAuth(handler func(conn http.ResponseWriter, req *http.Request)) func (conn http.ResponseWriter, req *http.Request) { return func (conn http.ResponseWriter, req *http.Request) { if !IsAuthorized(req) { + req.Body.Close() // http://code.google.com/p/go/issues/detail?id=1306 conn.SetHeader("WWW-Authenticate", "Basic realm=\"camlistored\"") conn.WriteHeader(http.StatusUnauthorized) fmt.Fprintf(conn, "Authentication required.\n") diff --git a/server/go/blobserver/camlistored.go b/server/go/blobserver/camlistored.go index eb5765a47..e94ecaf02 100644 --- a/server/go/blobserver/camlistored.go +++ b/server/go/blobserver/camlistored.go @@ -5,11 +5,11 @@ package main import ( - "auth" + "camli/auth" + "camli/http_util" "flag" "fmt" "http" - "http_util" "os" ) @@ -67,6 +67,7 @@ func main() { os.Exit(1) } + { fi, err := os.Stat(*flagStorageRoot) if err != nil || !fi.IsDirectory() { diff --git a/server/go/blobserver/get.go b/server/go/blobserver/get.go index b2ecb86fb..a6473908c 100644 --- a/server/go/blobserver/get.go +++ b/server/go/blobserver/get.go @@ -1,9 +1,9 @@ package main import ( + "camli/http_util" "fmt" "http" - "http_util" "os" "io" ) diff --git a/server/go/blobserver/preupload.go b/server/go/blobserver/preupload.go index 3e28e3790..02a1db051 100644 --- a/server/go/blobserver/preupload.go +++ b/server/go/blobserver/preupload.go @@ -1,10 +1,10 @@ package main import ( + "camli/http_util" "container/vector" "fmt" "http" - "http_util" "os" ) diff --git a/server/go/blobserver/temp_testing.go b/server/go/blobserver/temp_testing.go index a0799e310..a29a5b295 100644 --- a/server/go/blobserver/temp_testing.go +++ b/server/go/blobserver/temp_testing.go @@ -1,10 +1,10 @@ package main import ( + "camli/http_util" "crypto/sha1" "fmt" "http" - "http_util" "io" ) diff --git a/server/go/blobserver/upload.go b/server/go/blobserver/upload.go index 8817f1563..de2fe3214 100644 --- a/server/go/blobserver/upload.go +++ b/server/go/blobserver/upload.go @@ -1,9 +1,9 @@ package main import ( + "camli/http_util" "fmt" "http" - "http_util" "io" "io/ioutil" "os"