Skip to content

Commit a3238b3

Browse files
authored
Merge branch 'master' into graphql-ws
2 parents 8d035c5 + a5be3a8 commit a3238b3

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

juniper_actix/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ thiserror = "1.0"
2626
juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] }
2727
env_logger = "0.7.1"
2828
log = "0.4.3"
29-
percent-encoding = "1.0"
3029
tokio = { version = "0.2", features = ["rt-core", "macros", "blocking"] }
3130
actix-cors = "0.2.0"
3231
actix-identity = "0.2.0"

juniper_rocket_async/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ use std::io::Cursor;
4444
use rocket::{
4545
data::{self, FromData},
4646
http::{ContentType, RawStr, Status},
47+
outcome::Outcome::{Failure, Forward, Success},
4748
request::{FormItems, FromForm, FromFormValue},
4849
response::{self, content, Responder, Response},
49-
Data,
50-
Outcome::{Failure, Forward, Success},
51-
Request,
50+
Data, Request,
5251
};
5352

5453
use juniper::{

juniper_warp/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ warp = "0.2"
2727
env_logger = "0.7.1"
2828
juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] }
2929
log = "0.4.3"
30-
percent-encoding = "1.0"
30+
percent-encoding = "2"
3131
tokio = { version = "0.2", features = ["blocking", "macros", "rt-core"] }
32+
url = "2"

juniper_warp/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,16 @@ mod tests_http_harness {
767767

768768
impl HttpIntegration for TestWarpIntegration {
769769
fn get(&self, url: &str) -> TestResponse {
770-
use percent_encoding::{utf8_percent_encode, QUERY_ENCODE_SET};
770+
use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS};
771+
use url::Url;
771772

772-
let url: String = utf8_percent_encode(&url.replace("/?", ""), QUERY_ENCODE_SET)
773+
/// https://url.spec.whatwg.org/#query-state
774+
const QUERY_ENCODE_SET: &AsciiSet =
775+
&CONTROLS.add(b' ').add(b'"').add(b'#').add(b'<').add(b'>');
776+
777+
let url = Url::parse(&format!("http://localhost:3000{}", url)).expect("url to parse");
778+
779+
let url: String = utf8_percent_encode(url.query().unwrap_or(""), QUERY_ENCODE_SET)
773780
.into_iter()
774781
.collect::<Vec<_>>()
775782
.join("");

0 commit comments

Comments
 (0)