Skip to content

Commit

Permalink
don't export
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidliadon committed Oct 24, 2024
1 parent c8212eb commit 17155f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Options struct {

type ErrHandler func(r *http.Request, w http.ResponseWriter, err error)

func DefaultErrorHandler(r *http.Request, w http.ResponseWriter, err error) {
func errHandler(r *http.Request, w http.ResponseWriter, err error) {
rpcErr, ok := err.(proto.WebRPCError)
if !ok {
rpcErr = proto.ErrWebrpcEndpoint.WithCause(err)
Expand Down
4 changes: 2 additions & 2 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func Session(auth *jwtauth.JWTAuth, o *Options) func(next http.Handler) http.Handler {
eh := DefaultErrorHandler
eh := errHandler
if o != nil && o.ErrHandler != nil {
eh = o.ErrHandler
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func Session(auth *jwtauth.JWTAuth, o *Options) func(next http.Handler) http.Han
// AccessControl middleware that checks if the session type is allowed to access the endpoint.
// It also sets the compute units on the context if the endpoint requires it.
func AccessControl(acl Config[ACL], o *Options) func(next http.Handler) http.Handler {
eh := DefaultErrorHandler
eh := errHandler
if o != nil && o.ErrHandler != nil {
eh = o.ErrHandler
}
Expand Down

0 comments on commit 17155f9

Please sign in to comment.