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