Skip to content
Permalink
Browse files

adds support for webdav verbs (#966)

* improves CORS preflight check

* adds support for webdav verbs
  • Loading branch information...
shamsimam authored and sradack committed Sep 20, 2019
1 parent f973872 commit 0088a277e5fcfba93eee17793f7b5138b9423a99
Showing with 24 additions and 3 deletions.
  1. +18 −0 containers/test-apps/kitchen/bin/kitchen
  2. +6 −3 waiter/integration/waiter/basic_test.clj
@@ -367,18 +367,36 @@ class Kitchen(HTTPWebSocketsHandler):
def do_HEAD(self):
self.do_http_action('head')

def do_LOCK(self):
self.do_http_action('lock')

def do_MKCOL(self):
self.do_http_action('mkcol')

def do_MOVE(self):
self.do_http_action('move')

def do_OPTIONS(self):
self.do_http_action('options')

def do_PATCH(self):
self.do_http_action('patch')

def do_POST(self):
self.do_http_action('post')

def do_PROPFIND(self):
self.do_http_action('propfind')

def do_PROPPATCH(self):
self.do_http_action('proppatch')

def do_PUT(self):
self.do_http_action('put')

def do_UNLOCK(self):
self.do_http_action('unlock')

def do_http_action(self, method):
self.__logger = kitchen_logger
self.__method = method
@@ -132,13 +132,16 @@
(let [response (make-kitchen-request waiter-url request-headers :method :head :path "/request-info")]
(assert-response-status response 200)
(is (str/blank? (:body response)))))
(doseq [request-method [:delete :copy :get :move :patch :post :put]]
(doseq [request-method [:delete :copy :get :move :options :patch :post :put
;; additional webdav verbs
:lock :mkcol :propfind :proppatch :unlock]]
(testing (str "http method: " (-> request-method name str/upper-case))
(let [{:keys [body] :as response}
(let [{:keys [body headers] :as response}
(make-kitchen-request waiter-url request-headers :method request-method :path "/request-info")
body-json (json/read-str (str body))]
(assert-response-status response 200)
(is (= (name request-method) (get body-json "request-method")))))))
(is (= (name request-method) (get body-json "request-method")))
(is (str/includes? (str (get headers "server")) "Python"))))))

(testing "content headers"
(let [request-length 100000

0 comments on commit 0088a27

Please sign in to comment.
You can’t perform that action at this time.