Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

appview/metrics: support request hijacking

permits websocket upgrades in pipeline endpoints

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
date (May 12, 2026, 11:10 AM +0100) commit 3cb04fff parent 1b1a89a8 change-id kwokwpxz
+10
+10
appview/metrics/middleware.go
··· 1 1 package metrics 2 2 3 3 import ( 4 + "bufio" 4 5 "fmt" 6 + "net" 5 7 "net/http" 6 8 "time" 7 9 ··· 16 18 func (r *statusRecorder) WriteHeader(status int) { 17 19 r.status = status 18 20 r.ResponseWriter.WriteHeader(status) 21 + } 22 + 23 + func (r *statusRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) { 24 + h, ok := r.ResponseWriter.(http.Hijacker) 25 + if !ok { 26 + return nil, nil, fmt.Errorf("underlying ResponseWriter does not support hijacking") 27 + } 28 + return h.Hijack() 19 29 } 20 30 21 31 func Middleware(next http.Handler) http.Handler {