You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//! ```cargo//! [dependencies]//! itertools = "0.11.0"//! reqwest = "0.11.18"//! serde_json = "1.0.104"//! reqwest = { version = "0.11.18", features = ["json"] }//! tokio = { version = "1.29.1", features = ["full"] }//! ```use itertools::Itertools;#[tokio::main]asyncfnmain(){let url = reqwest::Url::parse(&format!("http://router.project-osrm.org/table/v1/driving/{}?sources=0",
(0..5000).map(|i| format!("13.{i:04},52.4242")).join(";"))).unwrap();dbg!(url.as_str());dbg!(reqwest::get(url)
.await
.unwrap()
.json::<serde_json::Value>()
.await
.unwrap());}
will trigger
thread 'main' panicked at 'a parsed Url should always be a valid Uri: InvalidUri(TooLong)', /home/julius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.11.18/src/into_url.rs:80:14
stack backtrace:
0: rust_begin_unwind
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
2: core::result::unwrap_failed
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/result.rs:1651:5
3: core::result::Result<T,E>::expect
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/result.rs:1033:23
4: reqwest::into_url::expect_uri
at /home/julius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.11.18/src/into_url.rs:78:9
5: reqwest::async_impl::client::Client::execute_request
at /home/julius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.11.18/src/async_impl/client.rs:1679:19
6: reqwest::async_impl::request::RequestBuilder::send
at /home/julius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.11.18/src/async_impl/request.rs:509:24
7: reqwest::get::{{closure}}
at /home/julius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.11.18/src/lib.rs:287:5
8: repro::main::{{closure}}
at ./src/main.rs:26:10
I'm not sure how this would be best resolved. There currently is a hard-coded maximum length in http and several similar issues have already been reported, ending in a PR that would bubble up that error instead of panicking. But personally, I'd very much like it if I could send this HTTP request. router.project-osrm.org may not respond to it, but if running the underlying osrm software locally, it is both possible and meaningful to make these (somewhat insanely) large requests.
The text was updated successfully, but these errors were encountered:
The following code
will trigger
I'm not sure how this would be best resolved. There currently is a hard-coded maximum length in http and several similar issues have already been reported, ending in a PR that would bubble up that error instead of panicking. But personally, I'd very much like it if I could send this HTTP request. router.project-osrm.org may not respond to it, but if running the underlying osrm software locally, it is both possible and meaningful to make these (somewhat insanely) large requests.
The text was updated successfully, but these errors were encountered: