File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -64,17 +64,17 @@ fn strip_connection_headers(headers: &mut HeaderMap, is_request: bool) {
6464 "Connection header illegal in HTTP/2: {}" ,
6565 CONNECTION . as_str( )
6666 ) ;
67- let header_contents = header. to_str ( ) . unwrap ( ) ;
68-
6967 // A `Connection` header may have a comma-separated list of names of other headers that
7068 // are meant for only this specific connection.
7169 //
7270 // Iterate these names and remove them as headers. Connection-specific headers are
7371 // forbidden in HTTP2, as that information has been moved into frame types of the h2
7472 // protocol.
75- for name in header_contents. split ( ',' ) {
76- let name = name. trim ( ) ;
77- headers. remove ( name) ;
73+ if let Ok ( header_contents) = header. to_str ( ) {
74+ for name in header_contents. split ( ',' ) {
75+ let name = name. trim ( ) ;
76+ headers. remove ( name) ;
77+ }
7878 }
7979 }
8080}
You can’t perform that action at this time.
0 commit comments