Skip to content

Conversation

@sotosof
Copy link

@sotosof sotosof commented Aug 3, 2017

Same as #1325 but into v1 branch.

sotosof added 2 commits August 3, 2017 21:53
From documentation of net/http.ResponseWriter.Write

    If WriteHeader has not yet been called, Write calls
    WriteHeader(http.StatusOK) before writing the data.

Without this fix, ResponseData which went through middleware which depends
on documented behavior of net/http.ResponseWriter.Write, basically which doesn't
call net/http.ResponseWriter.WriteHeader explicitly, ended in non Written
state. This leads into situation that NotFound handler will write into
ResponseData although middleware did the write already.
@raphael
Copy link
Member

raphael commented Aug 3, 2017

Thank you!

@raphael raphael merged commit 2a1ff6b into goadesign:v1 Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants