github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/go-chi/chi/middleware/closenotify18.go (about) 1 //go:build go1.8 || appengine 2 // +build go1.8 appengine 3 4 package middleware 5 6 import ( 7 "github.com/hellobchain/newcryptosm/http" 8 ) 9 10 // CloseNotify is a middleware that cancels ctx when the underlying 11 // connection has gone away. It can be used to cancel long operations 12 // on the server when the client disconnects before the response is ready. 13 // 14 // Note: this behaviour is standard in Go 1.8+, so the middleware does nothing 15 // on 1.8+ and exists just for backwards compatibility. 16 func CloseNotify(next http.Handler) http.Handler { 17 return next 18 }