Skip to content

Instantly share code, notes, and snippets.

@secwang
Created December 30, 2014 14:29
Show Gist options
  • Save secwang/dc9ed453b9080ecb07eb to your computer and use it in GitHub Desktop.
Save secwang/dc9ed453b9080ecb07eb to your computer and use it in GitHub Desktop.
(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