Skip to content

Commit 4a1c96b

Browse files
committed
feat: enhance location middleware to support multiple locations
1 parent f4d1ed0 commit 4a1c96b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

api-service/auth/middleware/location.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ func Location(service service.APIServiceInterface) mux.MiddlewareFunc {
5757
return
5858
}
5959

60+
splittedLocation := strings.Split(location, ",")
61+
if utils.ContainsSomeI(locations, splittedLocation...) {
62+
h.ServeHTTP(w, r)
63+
return
64+
}
65+
6066
w.WriteHeader(http.StatusForbidden)
6167
})
6268
}

0 commit comments

Comments
 (0)