Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created October 4, 2010 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KirinDave/e1b9d6920877fa5ed3bc to your computer and use it in GitHub Desktop.
Save KirinDave/e1b9d6920877fa5ed3bc to your computer and use it in GitHub Desktop.
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;
(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