Skip to content

Commit f05c292

Browse files
committed
fix bug
1 parent 0d10498 commit f05c292

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

coco.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import (
88

99
// Coco Framework
1010
type Coco struct {
11-
httpRouter *httprouter.Router
12-
Request *http.Request
13-
ResponseWriter http.ResponseWriter
14-
Params httprouter.Params
15-
AdditionResponseHeaders map[string]string
11+
httpRouter *httprouter.Router
12+
Request *http.Request
13+
ResponseWriter http.ResponseWriter
14+
Params httprouter.Params
15+
Header map[string]string
1616
}
1717

1818
func NewCoco() *Coco {
1919
c := Coco{
20-
httpRouter: httprouter.New(),
21-
AdditionResponseHeaders: make(map[string]string),
20+
httpRouter: httprouter.New(),
21+
Header: make(map[string]string),
2222
}
2323
return &c
2424
}
@@ -30,7 +30,7 @@ func (c *Coco) ServeHTTP(w http.ResponseWriter, r *http.Request) {
3030
//c.ResponseWriter = w
3131
//handler := c.Router.data[r.RequestURI]
3232
//handler(c)
33-
for key, val := range c.AdditionResponseHeaders {
33+
for key, val := range c.Header {
3434
w.Header().Set(key, val)
3535
}
3636
c.httpRouter.ServeHTTP(w, r)

0 commit comments

Comments
 (0)