Block Direct Requests
This commit is contained in:
@@ -23,13 +23,14 @@ func main() {
|
||||
|
||||
r.Use(cors.Handler(cors.Options{
|
||||
//AllowedOrigins: []string{"https://*", "http://*"}, //* Use this for development
|
||||
AllowedOrigins: GetEnvList("ALLOWED_ORIGINS", []string{"https://lk-api-temp.onrender.com"}), //* Use this for production
|
||||
AllowedOrigins: GetEnvList("ALLOWED_ORIGINS", []string{"https://utils.fernandovideira.com"}), //* Use this for production
|
||||
AllowedMethods: []string{"GET"},
|
||||
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
|
||||
ExposedHeaders: []string{"Link"},
|
||||
AllowCredentials: false,
|
||||
MaxAge: 300,
|
||||
}))
|
||||
r.Use(RefererCheck(GetEnvList("ALLOWED_ORIGINS", []string{"https://utils.fernandovideira.com"})))
|
||||
r.Use(RateLimiter(rps, burst))
|
||||
|
||||
r.Route("/v1", func(r chi.Router) {
|
||||
|
||||
Reference in New Issue
Block a user