Created
July 23, 2017 23:41
-
-
Save with-heart/82c1bd0bdd218b4daecb2b0f12e51572 to your computer and use it in GitHub Desktop.
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
class UriDecryptionFilter : ZuulFilter() { | |
private val encryptedStringRegex = | |
Regex("(?=.*[A-Z]+)(?=.*\\d+)([A-Z0-9]){12,}") | |
// ... | |
override fun shouldFilter(): Boolean { | |
val ctx = RequestContext.getCurrentContext() | |
val uri = ctx.request.requestURI | |
return encryptedStringRegex.find(uri) != null | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment