Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created February 25, 2011 15:36
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 jcromartie/843950 to your computer and use it in GitHub Desktop.
Save jcromartie/843950 to your computer and use it in GitHub Desktop.
(defn transfer
"Transfer a request to be handled as if it were for a different URI, but don't tell the client"
[req uri handler]
(if (= (:redirected-to req) uri)
(throw (Exception. (str "Already redirected to " uri "... no loops allowed")))
(handler (assoc req :uri uri :redirected-to uri))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment