File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,14 @@ impl Pseudo {
383383 None
384384 } ;
385385
386+ // For standard CONNECT (that is, without :protocol pseudo-header) scheme and path
387+ // are not set. See: [https://www.rfc-editor.org/rfc/rfc9114#section-4.4]
388+ let ( scheme, path) = if method == Method :: CONNECT && protocol. is_none ( ) {
389+ ( None , None )
390+ } else {
391+ ( scheme. or ( Some ( Scheme :: HTTPS ) ) , Some ( path) )
392+ } ;
393+
386394 let len = 3 + authority. is_some ( ) as usize + protocol. is_some ( ) as usize ;
387395
388396 //= https://www.rfc-editor.org/rfc/rfc9114#section-4.3
@@ -398,9 +406,9 @@ impl Pseudo {
398406 //# CONNECT request; see Section 4.4.
399407 Self {
400408 method : Some ( method) ,
401- scheme : scheme . or ( Some ( Scheme :: HTTPS ) ) ,
409+ scheme,
402410 authority,
403- path : Some ( path ) ,
411+ path,
404412 status : None ,
405413 protocol,
406414 len,
You can’t perform that action at this time.
0 commit comments