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