forked from mtusi2026/mtusi2026lab6
13 lines
270 B
Go
13 lines
270 B
Go
package middleware
|
|
|
|
import "net/http"
|
|
|
|
func Instance(id string) Middleware {
|
|
return func(next http.Handler) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("X-Instance-Id", id)
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|
|
}
|