auth: Addres review
This commit is contained in:
parent
b5c11f31b7
commit
6554db3e5f
@ -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 {
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user