From 45f6fe3bf10b1d490efa98a6d193b0ddc4fc51bf Mon Sep 17 00:00:00 2001 From: Daniel Bornkessel Date: Wed, 9 Jan 2013 12:47:33 +0100 Subject: [PATCH] Constantize string --- registry.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registry.go b/registry.go index a1747f1..20ff203 100644 --- a/registry.go +++ b/registry.go @@ -24,6 +24,7 @@ const ( jsonContentType = "application/json" contentType = "Content-Type" jsonSuffix = ".json" + authorization = "Authorization" ) /* @@ -124,7 +125,7 @@ func (register *Registry) YieldProtectedExporter(username, password string) http return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { authenticated := false - if auth := r.Header.Get("Authorization"); auth != "" { + if auth := r.Header.Get(authorization); auth != "" { base64Encoded := strings.SplitAfter(auth, " ")[1] decoded, err := base64.URLEncoding.DecodeString(base64Encoded) if err == nil {