Created
December 30, 2014 14:29
-
-
Save secwang/dc9ed453b9080ecb07eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn redirect | |
([url] (redirect url :found)) | |
([url type] | |
{:status (case type | |
:permanent 301 | |
:found 302 | |
:see-other 303 | |
:not-modified 304 | |
:proxy 305 | |
:temporary 307) | |
:headers {"Location" (str url)} | |
:body ""})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment