File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ where
131
131
}
132
132
133
133
fn url_from_httparse_req ( req : & httparse:: Request < ' _ , ' _ > ) -> http_types:: Result < Url > {
134
- let path_and_query = req. path . ok_or_else ( || format_err ! ( "No uri found" ) ) ?;
134
+ let path = req. path . ok_or_else ( || format_err ! ( "No uri found" ) ) ?;
135
135
136
136
let host = req
137
137
. headers
@@ -142,12 +142,12 @@ fn url_from_httparse_req(req: &httparse::Request<'_, '_>) -> http_types::Result<
142
142
143
143
let host = std:: str:: from_utf8 ( host) ?;
144
144
145
- if path_and_query . starts_with ( "http://" ) || path_and_query . starts_with ( "https://" ) {
146
- Ok ( Url :: parse ( path_and_query ) ?)
147
- } else if path_and_query . starts_with ( '/' ) {
148
- Ok ( Url :: parse ( & format ! ( "http://{}{}" , host, path_and_query ) ) ?)
145
+ if path . starts_with ( "http://" ) || path . starts_with ( "https://" ) {
146
+ Ok ( Url :: parse ( path ) ?)
147
+ } else if path . starts_with ( '/' ) {
148
+ Ok ( Url :: parse ( & format ! ( "http://{}{}" , host, path ) ) ?)
149
149
} else if req. method . unwrap ( ) . eq_ignore_ascii_case ( "connect" ) {
150
- Ok ( Url :: parse ( & format ! ( "http://{}/" , path_and_query ) ) ?)
150
+ Ok ( Url :: parse ( & format ! ( "http://{}/" , path ) ) ?)
151
151
} else {
152
152
Err ( format_err ! ( "unexpected uri format" ) )
153
153
}
You can’t perform that action at this time.
0 commit comments