mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
parent
6c54ff78a2
commit
57bf87258f
2
echo.go
2
echo.go
@ -295,7 +295,7 @@ func New() (e *Echo) {
|
|||||||
func (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context {
|
func (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context {
|
||||||
return &context{
|
return &context{
|
||||||
request: r,
|
request: r,
|
||||||
response: &Response{echo: e, Writer: w},
|
response: NewResponse(w, e),
|
||||||
store: make(Map),
|
store: make(Map),
|
||||||
echo: e,
|
echo: e,
|
||||||
pvalues: make([]string, *e.maxParam),
|
pvalues: make([]string, *e.maxParam),
|
||||||
|
@ -20,6 +20,11 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NewResponse creates a new instance of Response.
|
||||||
|
func NewResponse(w http.ResponseWriter, e *Echo) (r *Response) {
|
||||||
|
return &Response{Writer: w, echo: e}
|
||||||
|
}
|
||||||
|
|
||||||
// Header returns the header map for the writer that will be sent by
|
// Header returns the header map for the writer that will be sent by
|
||||||
// WriteHeader. Changing the header after a call to WriteHeader (or Write) has
|
// WriteHeader. Changing the header after a call to WriteHeader (or Write) has
|
||||||
// no effect unless the modified headers were declared as trailers by setting
|
// no effect unless the modified headers were declared as trailers by setting
|
||||||
|
Loading…
Reference in New Issue
Block a user