Closed stephenafamo closed 9 months ago
This one is necessary even with that.
The other pr (#350) makes the clientStateResponseWriter compatible with packages that need to inspect the underlying response writer.
This PR prevents a panic if the response writer was wrapped with a "Standard Library Wrapper" in between the ClientStateMiddleware and something that checks for it.
For example:
r := chi.NewRouter()
// loading the client state
r.Use(ab.LoadClientStateMiddleware)
// this will wrap the client state handler with an `UnwrappableResponseWriter`
r.Use(middleware.Logging)
// This will panic because it does not know how to unwrap the logging middleware
r.Use(ab.Middleware2(...))
This doesn't seem necessary with the other PR that adds the standard interface implementation?