mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
wip
This commit is contained in:
parent
7f2854d537
commit
05e075dd83
5 changed files with 25 additions and 23 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
type Context struct {
|
||||
RespWriter http.ResponseWriter
|
||||
Req *http.Request
|
||||
StatusCode int
|
||||
}
|
||||
|
||||
func New(w http.ResponseWriter, r *http.Request) *Context {
|
||||
|
@ -27,10 +28,7 @@ func (c *Context) Context() stdContext.Context {
|
|||
}
|
||||
|
||||
func (c *Context) Response() *http.Response {
|
||||
if c.Req != nil {
|
||||
if c.Req.Response == nil {
|
||||
c.Req.Response = &http.Response{Header: make(http.Header)}
|
||||
}
|
||||
if c.Req != nil && c.Req.Response != nil {
|
||||
return c.Req.Response
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue