перенос 3 лабы

This commit is contained in:
2026-10-28 12:40:39 +03:00
parent ec540a1a72
commit 7860d81fa1
115 changed files with 12814 additions and 0 deletions
@@ -0,0 +1,15 @@
package middleware
import "net/http"
const InstanceIDHeader = "X-Instance-Id"
// InstanceID identifies the process that actually produced the response.
// It must wrap recovery and routing so even errors, health checks and 404/405
// responses carry the same stable process identifier.
func InstanceID(instanceID string, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set(InstanceIDHeader, instanceID)
next.ServeHTTP(w, r)
})
}