From 73576834604eec81920a1a527f1e970ea65bd3d5 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 3 May 2020 16:04:16 +0200 Subject: [PATCH] update ValidateHeader signature --- auth-server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth-server.go b/auth-server.go index 6f687097..61da50a0 100644 --- a/auth-server.go +++ b/auth-server.go @@ -35,7 +35,7 @@ func (as *AuthServer) GenerateHeader() []string { // ValidateHeader validates the Authorization header sent by a client after receiving the // WWW-Authenticate header provided by GenerateHeader(). -func (as *AuthServer) ValidateHeader(header []string, method string, path string) error { +func (as *AuthServer) ValidateHeader(header []string, method Method, path string) error { if len(header) != 1 { return fmt.Errorf("Authorization header not provided") } @@ -87,7 +87,7 @@ func (as *AuthServer) ValidateHeader(header []string, method string, path string } ha1 := md5Hex(as.user + ":" + as.realm + ":" + as.pass) - ha2 := md5Hex(method + ":" + path) + ha2 := md5Hex(string(method) + ":" + path) response := md5Hex(ha1 + ":" + as.nonce + ":" + ha2) if inResponse != response {