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
131131}
132132
133133fn 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" ) ) ?;
135135
136136 let host = req
137137 . headers
@@ -142,12 +142,12 @@ fn url_from_httparse_req(req: &httparse::Request<'_, '_>) -> http_types::Result<
142142
143143 let host = std:: str:: from_utf8 ( host) ?;
144144
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 ) ) ?)
149149 } 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 ) ) ?)
151151 } else {
152152 Err ( format_err ! ( "unexpected uri format" ) )
153153 }
You can’t perform that action at this time.
0 commit comments