Skip to content

Commit

Permalink
Must write response header first
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Aug 8, 2020
1 parent c688029 commit d5753c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type Authorizer func(req *http.Request) (clientKey string, authed bool, err erro
type ErrorWriter func(rw http.ResponseWriter, req *http.Request, code int, err error)

func DefaultErrorWriter(rw http.ResponseWriter, req *http.Request, code int, err error) {
rw.Write([]byte(err.Error()))
rw.WriteHeader(code)
rw.Write([]byte(err.Error()))
}

type Server struct {
Expand Down

0 comments on commit d5753c5

Please sign in to comment.