Skip to content

Commit

Permalink
fix: Adjust code
Browse files Browse the repository at this point in the history
  • Loading branch information
dadav committed Mar 4, 2024
1 parent 2563de9 commit e7a3d07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ You can also enable the caching functionality to speed things up.`,

r := chi.NewRouter()

// Logger should come before any middleware that modifies the response
r.Use(middleware.Logger)
// Recoverer should also be pretty high in the middleware stack
r.Use(middleware.Recoverer)
r.Use(middleware.RealIP)
r.Use(customMiddleware.RequireUserAgent)
Expand Down
2 changes: 1 addition & 1 deletion internal/middleware/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func CacheMiddleware(prefixes []string, cacheDir string) func(next http.Handler)
}
}

if !matched {
if !matched || r.Method != "GET" {
next.ServeHTTP(w, r)
return
}
Expand Down
3 changes: 0 additions & 3 deletions internal/v3/api/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ func NewModuleOperationsApi() *ModuleOperationsApi {

// DeleteModule - Delete module
func (s *ModuleOperationsApi) DeleteModule(ctx context.Context, moduleSlug string, reason string) (gen.ImplResponse, error) {
// TODO - update DeleteModule with the required logic for this service method.
// Add api_module_operations_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.

// TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ...
// return Response(204, nil),nil

Expand Down

0 comments on commit e7a3d07

Please sign in to comment.