Update percent_encoding (#715)

Replaces https://github.com/graphql-rust/juniper/pull/702
This commit is contained in:
Christian Legnitto 2020-07-24 17:27:38 -10:00 committed by GitHub
parent 4647a32b33
commit fe6d622008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -26,7 +26,6 @@ thiserror = "1.0"
juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] }
env_logger = "0.7.1"
log = "0.4.3"
percent-encoding = "1.0"
tokio = { version = "0.2", features = ["rt-core", "macros", "blocking"] }
actix-cors = "0.2.0"
actix-identity = "0.2.0"

View file

@ -27,5 +27,6 @@ warp = "0.2"
env_logger = "0.7.1"
juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] }
log = "0.4.3"
percent-encoding = "1.0"
percent-encoding = "2"
tokio = { version = "0.2", features = ["blocking", "macros", "rt-core"] }
url = "2"

View file

@ -888,9 +888,16 @@ mod tests_http_harness {
impl HttpIntegration for TestWarpIntegration {
fn get(&self, url: &str) -> TestResponse {
use percent_encoding::{utf8_percent_encode, QUERY_ENCODE_SET};
use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS};
use url::Url;
let url: String = utf8_percent_encode(&url.replace("/?", ""), QUERY_ENCODE_SET)
/// https://url.spec.whatwg.org/#query-state
const QUERY_ENCODE_SET: &AsciiSet =
&CONTROLS.add(b' ').add(b'"').add(b'#').add(b'<').add(b'>');
let url = Url::parse(&format!("http://localhost:3000{}", url)).expect("url to parse");
let url: String = utf8_percent_encode(url.query().unwrap_or(""), QUERY_ENCODE_SET)
.into_iter()
.collect::<Vec<_>>()
.join("");