File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -2650,7 +2650,7 @@ func checkWriteHeaderCode(code int) {
2650
2650
// no equivalent bogus thing we can realistically send in HTTP/2,
2651
2651
// so we'll consistently panic instead and help people find their bugs
2652
2652
// early. (We can't return an error from WriteHeader even if we wanted to.)
2653
- if code < 100 || code > 999 {
2653
+ if code <= 100 || code > 999 {
2654
2654
panic (fmt .Sprintf ("invalid WriteHeader code %v" , code ))
2655
2655
}
2656
2656
}
@@ -2672,11 +2672,8 @@ func (rws *responseWriterState) writeHeader(code int) {
2672
2672
2673
2673
// Handle informational headers, except 100 (Continue) which is handled automatically
2674
2674
if code > 100 && code < 200 {
2675
- var h http.Header
2676
- if code == 103 {
2677
- // Per RFC 8297 we must not clear the current header map
2678
- h = rws .handlerHeader
2679
- }
2675
+ // Per RFC 8297 we must not clear the current header map
2676
+ h := rws .handlerHeader
2680
2677
2681
2678
if rws .conn .writeHeaders (rws .stream , & writeResHeaders {
2682
2679
streamID : rws .stream .id ,
@@ -2687,10 +2684,6 @@ func (rws *responseWriterState) writeHeader(code int) {
2687
2684
rws .dirty = true
2688
2685
}
2689
2686
2690
- if code == 103 {
2691
- rws .bw .Flush ()
2692
- }
2693
-
2694
2687
return
2695
2688
}
2696
2689
You can’t perform that action at this time.
0 commit comments