Unverified Commit c62afebd authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Redo url encoding (#368)

* Redo URL encoding to cover all cases

* Fix test that missed a couple of encodings

* Should have been escaping !
parent 42c1f215
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ impl<B: Into<hyper::Body>> tower::Service<http::Request<SdkBody>> for TestConnec
            self.requests
                .lock()
                .unwrap()
                .push(ValidateRequest { actual, expected });
                .push(ValidateRequest { expected, actual });
            std::future::ready(Ok(resp.map(|body| SdkBody::from(body.into()))))
        } else {
            std::future::ready(Err("No more data".into()))
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ class FluentClientGenerator(protocolConfig: ProtocolConfig) {

                pub fn from_conf_conn(conf: crate::Config, conn: #{aws_hyper}::conn::Standard) -> Self {
                    let client = #{aws_hyper}::Client::new(conn);
                    Self { handle: std::sync::Arc::new(Handle { conf, client })}
                    Self { handle: std::sync::Arc::new(Handle { client, conf })}
                }

                pub fn conf(&self) -> &crate::Config {
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ apply QueryPrecedence @httpRequestTests([
        method: "POST",
        uri: "/Precedence",
        body: "",
        queryParams: ["bar=%26%F0%9F%90%B1", "hello%20there=how's%20your%20encoding?", "a%20%26%20b%20%26%20c=better%20encode%20%3D%20this"],
        queryParams: ["bar=%26%F0%9F%90%B1", "hello%20there=how%27s%20your%20encoding%3F", "a%20%26%20b%20%26%20c=better%20encode%20%3D%20this"],
        params: {
            foo: "&🐱",
            baz: {
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ class RequestBindingGeneratorTest {
            assert_eq!(o.as_str(), "/somebucket%2Fok/1970-04-28T03%3A58%3A45Z");
            o.clear();
            inp.uri_query(&mut o);
            assert_eq!(o.as_str(), "?paramName=svq!!%25%26&hello=0&hello=1&hello=2&hello=44")
            assert_eq!(o.as_str(), "?paramName=svq%21%21%25%26&hello=0&hello=1&hello=2&hello=44")
            """
        )
    }
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ http-body = "0.4.0"
http = "0.2.3"
thiserror = "1"
pin-project = "1"
percent-encoding = "2.1.0"

# We are using hyper for our streaming body implementation, but this is an internal detail.
hyper = "0.14.5"
Loading