Created
March 17, 2015 06:09
-
-
Save alexanderfefelov/ed50ab81e2b74a8c0ab2 to your computer and use it in GitHub Desktop.
"GNU Terry Pratchett" Filter for Play Framework (Scala)
This file contains 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
object TerryPratchett extends EssentialFilter { | |
def apply(nextFilter: EssentialAction) = new EssentialAction { | |
def apply(requestHeader: RequestHeader) = { | |
nextFilter(requestHeader).map { result => | |
// https://www.reddit.com/r/discworld/comments/2yt9j6/gnu_terry_pratchett | |
result.withHeaders("X-Clacks-Overhead" -> "GNU Terry Pratchett") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment