Explorar el Código

Split auth on first colon

Michael Crosby hace 11 años
padre
commit
a37b155384
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      auth/auth.go

+ 1 - 1
auth/auth.go

@@ -63,7 +63,7 @@ func decodeAuth(authStr string) (string, string, error) {
 	if n > decLen {
 		return "", "", fmt.Errorf("Something went wrong decoding auth config")
 	}
-	arr := strings.Split(string(decoded), ":")
+	arr := strings.SplitN(string(decoded), ":", 2)
 	if len(arr) != 2 {
 		return "", "", fmt.Errorf("Invalid auth configuration file")
 	}