http

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyCaptureWriter

type BodyCaptureWriter struct {
	gin.ResponseWriter
	Body *bytes.Buffer
}

BodyCaptureWriter is a gin.ResponseWriter that captures the response body while allowing it to be written to the client

func NewBodyCaptureWriter

func NewBodyCaptureWriter(c *gin.Context) *BodyCaptureWriter

NewBodyCaptureWriter creates a new BodyCaptureWriter

func (*BodyCaptureWriter) GetBody

func (w *BodyCaptureWriter) GetBody() string

GetBody returns the captured response body as a string

func (*BodyCaptureWriter) Unwrap added in v0.34.12

Unwrap exposes the underlying gin.ResponseWriter so http.ResponseController can reach connection-level controls (SetReadDeadline etc.) through the capture layers. Without it, the double capture the logging + error-handler middlewares install makes every ResponseController feature return ErrNotSupported — silently disarming the upload drain's time bound (the #1608 review's correctness finding 1).

func (*BodyCaptureWriter) Write

func (w *BodyCaptureWriter) Write(b []byte) (int, error)

Write captures the response body and forwards it to the underlying ResponseWriter

func (*BodyCaptureWriter) WriteString

func (w *BodyCaptureWriter) WriteString(s string) (int, error)

WriteString captures the string response and forwards it to the underlying ResponseWriter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL