Skip to content

Instantly share code, notes, and snippets.

@wmfairuz
Created December 16, 2014 02:54
Show Gist options
  • Save wmfairuz/85e62bc7739daf2fa155 to your computer and use it in GitHub Desktop.
Save wmfairuz/85e62bc7739daf2fa155 to your computer and use it in GitHub Desktop.
custom header
+ [liberator.representation :only [Representation ring-response]]
+(defn add-header [response header-key header-value]
+ (assoc-in response [:headers header-key] header-value))
+ :as-response (fn [d ctx]
+ (do
+ (info (liberator.representation/as-response d ctx))
+ (-> (liberator.representation/as-response d ctx)
+ (add-header "FOO" "BAR")
+ (add-header "Lorem" "Ipsum"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment