File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ func New() (e *Echo) {
295295func (e * Echo ) NewContext (r * http.Request , w http.ResponseWriter ) Context {
296296 return & context {
297297 request : r ,
298- response : & Response { echo : e , Writer : w } ,
298+ response : NewResponse ( w , e ) ,
299299 store : make (Map ),
300300 echo : e ,
301301 pvalues : make ([]string , * e .maxParam ),
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ type (
2020 }
2121)
2222
23+ // NewResponse creates a new instance of Response.
24+ func NewResponse (w http.ResponseWriter , e * Echo ) (r * Response ) {
25+ return & Response {Writer : w , echo : e }
26+ }
27+
2328// Header returns the header map for the writer that will be sent by
2429// WriteHeader. Changing the header after a call to WriteHeader (or Write) has
2530// no effect unless the modified headers were declared as trailers by setting
You can’t perform that action at this time.
0 commit comments