mirror of
https://github.com/safing/portbase
synced 2025-09-16 18:19:50 +00:00
Finish first API version
This commit is contained in:
parent
d7e0602548
commit
31c09512a0
6 changed files with 175 additions and 22 deletions
22
api/enriched-response.go
Normal file
22
api/enriched-response.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type EnrichedResponseWriter struct {
|
||||
http.ResponseWriter
|
||||
Status int
|
||||
}
|
||||
|
||||
func NewEnrichedResponseWriter(w http.ResponseWriter) *EnrichedResponseWriter {
|
||||
return &EnrichedResponseWriter{
|
||||
w,
|
||||
0,
|
||||
}
|
||||
}
|
||||
|
||||
func (ew *EnrichedResponseWriter) WriteHeader(code int) {
|
||||
ew.Status = code
|
||||
ew.ResponseWriter.WriteHeader(code)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue