Update url dependency (#432)

This commit is contained in:
Christian Legnitto 2019-09-29 18:47:37 -07:00 committed by GitHub
parent 5be66654a9
commit 02fd164e96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 7 deletions

View file

@ -1,5 +1,6 @@
# master # master
- Require `url` 2.x if `url` feature is enabled.
- Improve lookahead visitability. - Improve lookahead visitability.
- Add ability to parse 'subscription'. - Add ability to parse 'subscription'.

View file

@ -41,7 +41,7 @@ serde_derive = { version = "1.0.2" }
chrono = { version = "0.4.0", optional = true } chrono = { version = "0.4.0", optional = true }
serde_json = { version="1.0.2", optional = true } serde_json = { version="1.0.2", optional = true }
url = { version = "1.5.1", optional = true } url = { version = "2", optional = true }
uuid = { version = "0.7", optional = true } uuid = { version = "0.7", optional = true }
[dev-dependencies] [dev-dependencies]

View file

@ -12,7 +12,7 @@ edition = "2018"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
url = "1.7" url = "2"
juniper = { version = "0.13.1" , default-features = false, path = "../juniper"} juniper = { version = "0.13.1" , default-features = false, path = "../juniper"}
futures = "0.1" futures = "0.1"

View file

@ -27,7 +27,7 @@ fn main() {
let new_service = move || { let new_service = move || {
let root_node = root_node.clone(); let root_node = root_node.clone();
let ctx = db.clone(); let ctx = db.clone();
service_fn(move |req| -> Box<Future<Item = _, Error = _> + Send> { service_fn(move |req| -> Box<dyn Future<Item = _, Error = _> + Send> {
let root_node = root_node.clone(); let root_node = root_node.clone();
let ctx = ctx.clone(); let ctx = ctx.clone();
match (req.method(), req.uri().path()) { match (req.method(), req.uri().path()) {

View file

@ -25,7 +25,8 @@ iron-test = "0.6"
router = "0.6" router = "0.6"
mount = "0.4" mount = "0.4"
logger = "0.4" logger = "0.4"
url = "1.7.1" url = "2"
percent-encoding = "2"
[dev-dependencies.juniper] [dev-dependencies.juniper]
version = "0.13.1" version = "0.13.1"

View file

@ -431,7 +431,7 @@ mod tests {
use super::*; use super::*;
use iron::{Handler, Headers, Url}; use iron::{Handler, Headers, Url};
use iron_test::{request, response}; use iron_test::{request, response};
use url::percent_encoding::{utf8_percent_encode, DEFAULT_ENCODE_SET}; use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS};
use juniper::{ use juniper::{
http::tests as http_tests, http::tests as http_tests,
@ -441,6 +441,9 @@ mod tests {
use super::GraphQLHandler; use super::GraphQLHandler;
/// https://url.spec.whatwg.org/#query-state
const QUERY_ENCODE_SET: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'#').add(b'<').add(b'>');
// This is ugly but it works. `iron_test` just dumps the path/url in headers // This is ugly but it works. `iron_test` just dumps the path/url in headers
// and newer `hyper` doesn't allow unescaped "{" or "}". // and newer `hyper` doesn't allow unescaped "{" or "}".
fn fixup_url(url: &str) -> String { fn fixup_url(url: &str) -> String {
@ -454,7 +457,7 @@ mod tests {
format!( format!(
"http://localhost:3000{}?{}", "http://localhost:3000{}?{}",
path, path,
utf8_percent_encode(url.query().unwrap_or(""), DEFAULT_ENCODE_SET) utf8_percent_encode(url.query().unwrap_or(""), QUERY_ENCODE_SET)
) )
} }
@ -521,7 +524,7 @@ mod tests {
} }
} }
fn make_handler() -> Box<Handler> { fn make_handler() -> Box<dyn Handler> {
Box::new(GraphQLHandler::new( Box::new(GraphQLHandler::new(
context_factory, context_factory,
Query, Query,