Compare commits
2 Commits
2ee48560b6
...
d57f60c710
Author | SHA1 | Date |
---|---|---|
Adrien Marquès | d57f60c710 | |
Adrien Marquès | ad6de97979 |
2
http.go
2
http.go
|
@ -60,6 +60,7 @@ func (server httpServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
for _, handler := range server.handlers {
|
for _, handler := range server.handlers {
|
||||||
if handler.GetMethod() == service.Method && handler.GetPath() == service.Pattern {
|
if handler.GetMethod() == service.Method && handler.GetPath() == service.Pattern {
|
||||||
|
foundHandler = handler
|
||||||
found = true
|
found = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,6 +97,7 @@ func (server httpServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||||
foundHandler.Handle(*apireq, response)
|
foundHandler.Handle(*apireq, response)
|
||||||
|
|
||||||
// 11. apply headers
|
// 11. apply headers
|
||||||
|
res.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
for key, values := range response.Headers {
|
for key, values := range response.Headers {
|
||||||
for _, value := range values {
|
for _, value := range values {
|
||||||
res.Header().Add(key, value)
|
res.Header().Add(key, value)
|
||||||
|
|
Loading…
Reference in New Issue