Skip to content

Commit

Permalink
Merge pull request #6 from jmccann/json
Browse files Browse the repository at this point in the history
write header after having configured it
  • Loading branch information
Jesse0Michael authored Jun 5, 2018
2 parents d34f5ab + c56c003 commit d3aa03f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assured/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ func decodeAssuredCallback(ctx context.Context, req *http.Request) (interface{},
func encodeAssuredCall(ctx context.Context, w http.ResponseWriter, i interface{}) error {
switch resp := i.(type) {
case *Call:
w.WriteHeader(resp.StatusCode)
for key, value := range resp.Headers {
if !strings.HasPrefix(key, "Assured-") {
w.Header().Set(key, value)
}
}
w.WriteHeader(resp.StatusCode)
w.Write([]byte(resp.String()))
case []*Call:
w.Header().Set("Content-Type", "application/json")
Expand Down

0 comments on commit d3aa03f

Please sign in to comment.