File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,19 @@ Middleware forms a processing pipeline where each step can affect subsequent ste
81
81
// Logging captures the actual request after security filtering
82
82
// Content headers set last prevent handlers from overriding them
83
83
84
+ import (
85
+ " github.com/robbyt/go-supervisor/runnables/httpserver/middleware/recovery"
86
+ " github.com/robbyt/go-supervisor/runnables/httpserver/middleware/headers"
87
+ " github.com/robbyt/go-supervisor/runnables/httpserver/middleware/logger"
88
+ " github.com/robbyt/go-supervisor/runnables/httpserver/middleware/metrics"
89
+ )
90
+
84
91
middlewares := []httpserver.HandlerFunc {
85
92
recovery.New (lgr), // Catches panics - must wrap everything
86
- headersMw .Security (), // Security headers - always applied
93
+ headers .Security (), // Security headers - always applied
87
94
logger.New (lgr), // Logs what actually gets processed
88
95
metrics.New (), // Measures performance
89
- headersMw .JSON (), // Sets content type - easily overridden
96
+ headers .JSON (), // Sets content type - easily overridden
90
97
}
91
98
```
92
99
You can’t perform that action at this time.
0 commit comments