-
-
Save KirinDave/e1b9d6920877fa5ed3bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decision(v3c3) -> | |
PTypes = [Type || {Type,_Fun} <- resource_call(content_types_provided)], | |
case get_header_val("accept") of | |
undefined -> | |
wrcall({set_metadata, 'content-type', hd(PTypes)}), | |
d(v3d4); | |
_ -> | |
d(v3c4) | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defstate b4 | |
:test s/valid-entity-length? | |
:yes :b3 | |
:no (stop-response 413)) | |
(defstate b3 | |
:body (fn [{:keys [handler request] :as args}] | |
(if (= :options (:requestmethod request)) | |
(let [options-headers (or (s/options handler request) {})] | |
{:status 200 | |
:body "" | |
:headers options-headers}) | |
(c3 args)))) | |
(defstate c3 | |
:test (fn [handler request] | |
(if-let [acceptv ((:headers request) "accept")] | |
))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment