From 904d5057126daddfc884016f8991e9640b5879d1 Mon Sep 17 00:00:00 2001 From: Shams Imam Date: Fri, 4 May 2018 09:40:13 -0500 Subject: [PATCH 1/2] updates jetty version to 9.4.9.v20180320 --- kitchen/project.clj | 2 +- token-syncer/project.clj | 2 +- waiter/project.clj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kitchen/project.clj b/kitchen/project.clj index 4a5509146..b29c6d0cd 100644 --- a/kitchen/project.clj +++ b/kitchen/project.clj @@ -10,7 +10,7 @@ ;; (defproject kitchen "0.1.0-SNAPSHOT" :dependencies [^{:voom {:repo "https://github.com/twosigma/jet.git" :branch "waiter-patch"}} - [cc.qbits/jet "0.7.10-20180124_201515-g857338f"] + [cc.qbits/jet "0.7.10-20180504_143513-g8f00b45"] [log4j/log4j "1.2.17" :exclusions [javax.mail/mail javax.jms/jms com.sun.jmdk/jmxtools diff --git a/token-syncer/project.clj b/token-syncer/project.clj index 7fca6c8ef..1fa7b9b0e 100644 --- a/token-syncer/project.clj +++ b/token-syncer/project.clj @@ -10,7 +10,7 @@ ;; (defproject token-syncer "0.1.0-SNAPSHOT" :dependencies [^{:voom {:repo "https://github.com/twosigma/jet.git" :branch "waiter-patch"}} - [cc.qbits/jet "0.7.10-20180410_173552-gb29616d"] + [cc.qbits/jet "0.7.10-20180504_143513-g8f00b45"] [clj-time "0.12.0"] [commons-codec/commons-codec "1.10"] [org.clojure/clojure "1.8.0"] diff --git a/waiter/project.clj b/waiter/project.clj index 13a975d6a..f928cad4a 100644 --- a/waiter/project.clj +++ b/waiter/project.clj @@ -26,7 +26,7 @@ :dependencies [[bidi "2.0.16" :exclusions [prismatic/schema ring/ring-core]] ^{:voom {:repo "https://github.com/twosigma/jet.git" :branch "waiter-patch"}} - [cc.qbits/jet "0.7.10-20180410_173552-gb29616d"] + [cc.qbits/jet "0.7.10-20180504_143513-g8f00b45"] ^{:voom {:repo "https://github.com/twosigma/clj-http.git" :branch "waiter-patch"}} [clj-http "1.0.2-20180124_201819-gcdf23e5" :exclusions [commons-io org.clojure/tools.reader potemkin slingshot]] From c7dfae17e02d6672432353511cbb3eb9a5dd81bd Mon Sep 17 00:00:00 2001 From: Shams Imam Date: Fri, 4 May 2018 11:15:40 -0500 Subject: [PATCH 2/2] handles empty strings in headers --- token-syncer/integration/token_syncer/basic_test.clj | 2 +- waiter/integration/waiter/basic_test.clj | 2 +- waiter/src/waiter/token.clj | 2 +- waiter/src/waiter/util/client_tools.clj | 2 +- waiter/src/waiter/util/http_utils.clj | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/token-syncer/integration/token_syncer/basic_test.clj b/token-syncer/integration/token_syncer/basic_test.clj index d12ae7017..1bd7a721f 100644 --- a/token-syncer/integration/token_syncer/basic_test.clj +++ b/token-syncer/integration/token_syncer/basic_test.clj @@ -86,7 +86,7 @@ ;; ASSERT (let [waiter-sync-result (constantly {:code :success/hard-delete - :details {:etag token-etag + :details {:etag (str token-etag) :status 200}}) expected-result {:details {token-name {:latest {:cluster-url (first waiter-urls) :description token-description diff --git a/waiter/integration/waiter/basic_test.clj b/waiter/integration/waiter/basic_test.clj index 6f7e49026..bf45f567a 100644 --- a/waiter/integration/waiter/basic_test.clj +++ b/waiter/integration/waiter/basic_test.clj @@ -48,7 +48,7 @@ (is (get-in body-json ["headers" "authorization"]) (str body)) (is (get-in body-json ["headers" "x-waiter-auth-principal"]) (str body)) (is (get-in body-json ["headers" "x-cid"]) (str body)) - (is (nil? (get-in body-json ["headers" "content-type"])) (str body)) + (is (str/blank? (get-in body-json ["headers" "content-type"])) (str body)) (is (= "0" (get-in body-json ["headers" "content-length"])) (str body)) (is (= "text/plain" (get-in body-json ["headers" "accept"])) (str body)))) diff --git a/waiter/src/waiter/token.clj b/waiter/src/waiter/token.clj index e2bf3d91e..52443bc35 100644 --- a/waiter/src/waiter/token.clj +++ b/waiter/src/waiter/token.clj @@ -47,7 +47,7 @@ "Validates whether the token modification should be allowed on based on the provided token version-hash." [{:keys [token-metadata] :as token-description} version-hash] (when version-hash - (when (not= (token-description->token-hash token-description) (str version-hash)) + (when (not= (str (token-description->token-hash token-description)) (str version-hash)) (throw (ex-info "Cannot modify stale token" {:provided-version version-hash :status 412 diff --git a/waiter/src/waiter/util/client_tools.clj b/waiter/src/waiter/util/client_tools.clj index e79835add..70dbe9be3 100644 --- a/waiter/src/waiter/util/client_tools.clj +++ b/waiter/src/waiter/util/client_tools.clj @@ -257,7 +257,7 @@ multipart (assoc :multipart multipart) add-spnego-auth (assoc :auth (spnego/spnego-authentication (URI. request-url))) form-params (assoc :form-params form-params) - content-type (assoc :content-type content-type) + (not (str/blank? content-type)) (assoc :content-type content-type) cookies (assoc :cookies (map (fn [c] [(:name c) (:value c)]) cookies))))) response-body (if body (async/