mirror of
https://github.com/safing/portbase
synced 2025-04-12 13:39:09 +00:00
Add response headers to APIRequest
This commit is contained in:
parent
f2208faf8c
commit
82ed043721
2 changed files with 6 additions and 0 deletions
|
@ -436,6 +436,9 @@ func (e *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
// Add response headers to request struct so that the endpoint can work with them.
|
||||
apiRequest.ResponseHeader = w.Header()
|
||||
|
||||
// Execute action function and get response data
|
||||
var responseData []byte
|
||||
var err error
|
||||
|
|
|
@ -26,6 +26,9 @@ type Request struct {
|
|||
// AuthToken is the request-side authentication token assigned.
|
||||
AuthToken *AuthToken
|
||||
|
||||
// ResponseHeader holds the response header.
|
||||
ResponseHeader http.Header
|
||||
|
||||
// HandlerCache can be used by handlers to cache data between handlers within a request.
|
||||
HandlerCache interface{}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue