Documentation
¶
Overview ¶
Package response provides small, transport-neutral HTTP response helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLocalPath ¶
IsLocalPath reports whether value is safe to use as a root-relative redirect.
Types ¶
type StatusWriter ¶
type StatusWriter struct {
http.ResponseWriter
Status int
}
StatusWriter records the final HTTP status while preserving response-controller support.
func NewStatusWriter ¶
func NewStatusWriter(w http.ResponseWriter) *StatusWriter
NewStatusWriter wraps w with final-status diagnostics.
func (*StatusWriter) FlushError ¶
func (w *StatusWriter) FlushError() error
FlushError flushes the underlying response after recording an implicit status.
func (*StatusWriter) Unwrap ¶
func (w *StatusWriter) Unwrap() http.ResponseWriter
Unwrap returns the underlying response writer.
func (*StatusWriter) Write ¶
func (w *StatusWriter) Write(data []byte) (int, error)
Write records an implicit successful status before writing data.
func (*StatusWriter) WriteHeader ¶
func (w *StatusWriter) WriteHeader(status int)
WriteHeader records the first final status before passing it through.
Click to show internal directories.
Click to hide internal directories.