mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-19 00:36:38 +00:00
* implement reverse proxy --------- Co-authored-by: Alisdair MacLeod <git@alisdairmacleod.co.uk> Co-authored-by: mlsmaycon <mlsmaycon@gmail.com> Co-authored-by: Eduard Gert <kontakt@eduardgert.de> Co-authored-by: Viktor Liu <viktor@netbird.io> Co-authored-by: Diego Noguês <diego.sure@gmail.com> Co-authored-by: Diego Noguês <49420+diegocn@users.noreply.github.com> Co-authored-by: Bethuel Mmbaga <bethuelmbaga12@gmail.com> Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com> Co-authored-by: Ashley Mensah <ashleyamo982@gmail.com>
27 lines
557 B
Go
27 lines
557 B
Go
package accesslog
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// statusWriter is a simple wrapper around an http.ResponseWriter
|
|
// that captures the setting of the status code via the WriteHeader
|
|
// function and stores it so that it can be retrieved later.
|
|
type statusWriter struct {
|
|
w http.ResponseWriter
|
|
status int
|
|
}
|
|
|
|
func (w *statusWriter) Header() http.Header {
|
|
return w.w.Header()
|
|
}
|
|
|
|
func (w *statusWriter) Write(data []byte) (int, error) {
|
|
return w.w.Write(data)
|
|
}
|
|
|
|
func (w *statusWriter) WriteHeader(status int) {
|
|
w.status = status
|
|
w.w.WriteHeader(status)
|
|
}
|