Created
December 16, 2014 02:54
-
-
Save wmfairuz/85e62bc7739daf2fa155 to your computer and use it in GitHub Desktop.
custom header
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
+ [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