Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bcho committed Oct 1, 2023
1 parent a43e30b commit 17f62a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ func (opts *ServerSecurityOptions) defaults() error {
func (opts *ServerSecurityOptions) createTableOrViewAccessCheckMiddleware(
responseErr func(w http.ResponseWriter, err error),
) func(http.Handler) http.Handler {
accesibleTableOrViews := make(map[string]struct{})
accessibleTableOrViews := make(map[string]struct{})
for _, t := range opts.EnabledTableOrViews {
accesibleTableOrViews[t] = struct{}{}
accessibleTableOrViews[t] = struct{}{}
}

return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
target := chi.URLParam(req, routeVarTableOrView)

if _, ok := accesibleTableOrViews[target]; !ok {
if _, ok := accessibleTableOrViews[target]; !ok {
responseErr(w, ErrAccessRestricted)
return
}
Expand Down

0 comments on commit 17f62a9

Please sign in to comment.