Skip to content

Instantly share code, notes, and snippets.

@with-heart
Created July 23, 2017 23:41
Show Gist options
  • Save with-heart/82c1bd0bdd218b4daecb2b0f12e51572 to your computer and use it in GitHub Desktop.
Save with-heart/82c1bd0bdd218b4daecb2b0f12e51572 to your computer and use it in GitHub Desktop.
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