MCPcopy Create free account
hub / github.com/labstack/echo / TestGzipResponseWriter_CanHijack

Function TestGzipResponseWriter_CanHijack

middleware/compress_test.go:360–367  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

358}
359
360func TestGzipResponseWriter_CanHijack(t *testing.T) {
361 trwu := testResponseWriterUnwrapperHijack{testResponseWriterUnwrapper: testResponseWriterUnwrapper{rw: httptest.NewRecorder()}}
362 bdrw := gzipResponseWriter{
363 ResponseWriter: &trwu, // this RW supports hijacking through unwrapping
364 }
365 _, _, err := bdrw.Hijack()
366 assert.EqualError(t, err, "can hijack")
367}
368
369func TestGzipResponseWriter_CanNotHijack(t *testing.T) {
370 trwu := testResponseWriterUnwrapper{rw: httptest.NewRecorder()}

Callers

nothing calls this directly

Calls 1

HijackMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…