coder / coder/websocket

Hijack before WriteHeader to avoid issues with middleware and Gin

Aperta
#335 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Go
Stelle
5.5k
Fork
372
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I tried to upgrade to your library in one of my projects [msgbus](https://git.mills.io/prologic/msgbus) in [this commit](https://git.mills.io/prologic/msgbus/commit/ec8dbec63232c1c78881a19a18e11f4dd9b63935) but unfortunately ran into [some issues](https://git.mills.io/prologic/msgbus/commit/ec8dbec63232c1c78881a19a18e11f4dd9b63935) and had to [revert](https://git.mills.io/prologic/msgbus/commit/6a840a26b42c9c8986502e6b3c7fa5a17700c6a7)

It would appear that the interaction between Logging and GZIP MIddleware is not playing nicely, whereas the old `gorilla/websocket` library was handling this fine.

Basic error I'm seeing is:

```
2022/03/27 02:23:54 http: response.WriteHeader on hijacked connection from github.com/unrolled/logger.(*customResponseWriter).WriteHeader (logger.go:108)
```

Can we fix this somehow so that your library plays nicely with middleware that wraps it potentially?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.