Skip to content

Instantly share code, notes, and snippets.

@with-heart
Created July 24, 2017 00:05
Show Gist options
  • Save with-heart/3b98e76d834e5ae82054733cc048e3aa to your computer and use it in GitHub Desktop.
Save with-heart/3b98e76d834e5ae82054733cc048e3aa to your computer and use it in GitHub Desktop.
override fun run(): Any? {
val ctx = RequestContext.getCurrentContext()
val uri = ctx.request.requestURI
val encrypted = encryptedStringRegex.find(uri)!!.value
val decrypted = encrypted.reversed()
val newUri = encryptedStringRegex.replace(uri, decrypted)
val newRequest = object : HttpServletRequestWrapper(ctx.request) {
override fun getRequestURI() = newUri
}
ctx.request = newRequest
return null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment