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) w.WriteHeader(401)
return return
} }
token = token[len("Bearer "):] token = strings.TrimPrefix(token, "Bearer ")
allow, err := h.Verify(ctx, token) allow, err := h.Verify(ctx, token)
if err != nil { if err != nil {

View File

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