We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a10117f commit 9be4f19Copy full SHA for 9be4f19
modules/caddyhttp/responsewriter.go
@@ -219,13 +219,13 @@ func (rr *responseRecorder) Buffered() bool {
219
}
220
221
func (rr *responseRecorder) WriteResponse() error {
222
- if rr.stream {
223
- return nil
224
- }
225
if rr.statusCode == 0 {
226
// could happen if no handlers actually wrote anything,
227
// and this prevents a panic; status must be > 0
228
- rr.statusCode = http.StatusOK
+ rr.WriteHeader(http.StatusOK)
+ }
+ if rr.stream {
+ return nil
229
230
rr.ResponseWriterWrapper.WriteHeader(rr.statusCode)
231
_, err := io.Copy(rr.ResponseWriterWrapper, rr.buf)
0 commit comments