File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
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
}
@@ -2673,7 +2673,14 @@ func (rws *responseWriterState) writeHeader(code int) {
2673
2673
checkWriteHeaderCode (code )
2674
2674
2675
2675
// Handle informational headers, except 100 (Continue) which is handled automatically
2676
- if code > 100 && code < 200 {
2676
+ if code >= 100 && code < 200 {
2677
+ if code == 100 && rws .body .needsContinue {
2678
+ rws .body .needsContinue = false
2679
+ rws .conn .write100ContinueHeaders (rws .body .stream )
2680
+
2681
+ return
2682
+ }
2683
+
2677
2684
// Per RFC 8297 we must not clear the current header map
2678
2685
h := rws .handlerHeader
2679
2686
You can’t perform that action at this time.
0 commit comments