auth: Addres review

This commit is contained in:
Łukasz Magiera 2019-07-23 21:38:10 +02:00
parent b5c11f31b7
commit 6554db3e5f
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(401)
return
}
token = token[len("Bearer "):]
token = strings.TrimPrefix(token, "Bearer ")
allow, err := h.Verify(ctx, token)
if err != nil {

View File

@ -56,7 +56,7 @@ type ClientCloser func()
// NewClient creates new josnrpc 2.0 client
//
// handler must be pointer to a struct with function fields
// Returned value closes the client connectionnil
// Returned value closes the client connection
// TODO: Example
func NewClient(addr string, namespace string, handler interface{}, requestHeader http.Header) (ClientCloser, error) {
htyp := reflect.TypeOf(handler)