diff --git a/cover.html b/cover.html
new file mode 100644
index 0000000..3e764a4
--- /dev/null
+++ b/cover.html
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
package header
+
+import (
+ "encoding/base64"
+ "net/http"
+ "strings"
+
+ "github.com/gopatchy/jsrest"
+)
+
+func ParseAuthorization(r *http.Request) (string, string) {
+ auth := r.Header.Get("Authorization")
+
+ if auth == "" {
+ return "", ""
+ }
+
+ parts := strings.Split(auth, " ")
+ if len(parts) != 2 {
+ return "", ""
+ }
+
+ return parts[0], parts[1]
+}
+
+func ParseBasic(val string) (string, string, error) {
+ raw, err := base64.StdEncoding.DecodeString(val)
+ if err != nil {
+ return "", "", jsrest.Errorf(jsrest.ErrBadRequest, "Authorization header Basic data base64 decode failed (%w)", err)
+ }
+
+ parts := strings.SplitN(string(raw), ":", 2)
+ if len(parts) != 2 {
+ return "", "", jsrest.Errorf(jsrest.ErrBadRequest, "Authorization header Basic data malformed")
+ }
+
+ return parts[0], parts[1], nil
+}
+
+
+
+
+
+
diff --git a/cover.out b/cover.out
new file mode 100644
index 0000000..69af464
--- /dev/null
+++ b/cover.out
@@ -0,0 +1,11 @@
+mode: atomic
+github.com/gopatchy/header/authorization.go:11.59,14.16 2 2
+github.com/gopatchy/header/authorization.go:14.16,16.3 1 0
+github.com/gopatchy/header/authorization.go:18.2,19.21 2 2
+github.com/gopatchy/header/authorization.go:19.21,21.3 1 0
+github.com/gopatchy/header/authorization.go:23.2,23.27 1 2
+github.com/gopatchy/header/authorization.go:26.53,28.16 2 1
+github.com/gopatchy/header/authorization.go:28.16,30.3 1 0
+github.com/gopatchy/header/authorization.go:32.2,33.21 2 1
+github.com/gopatchy/header/authorization.go:33.21,35.3 1 0
+github.com/gopatchy/header/authorization.go:37.2,37.32 1 1