Created
August 15, 2014 16:04
-
-
Save wpf500/ac3b161269107d8e5f60 to your computer and use it in GitHub Desktop.
Conditional CSRFFilter
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
class CSRFFilterWithExemptions extends EssentialFilter { | |
val csrfFilter = CSRFFilter() | |
def apply(next: EssentialAction): EssentialAction = new EssentialAction { | |
def apply(rh: RequestHeader): Iteratee[Array[Byte], Result] = { | |
if (/* some test here */) { | |
csrfFilter(next)(rh) | |
} else { | |
next(rh) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment