Skip to content

Instantly share code, notes, and snippets.

@dllewellyn
Last active November 19, 2022 19:24
Show Gist options
  • Save dllewellyn/1175143b487b3ac641de4995a1032ced to your computer and use it in GitHub Desktop.
Save dllewellyn/1175143b487b3ac641de4995a1032ced to your computer and use it in GitHub Desktop.
Example of url verification code
fun mySecureFunction(websiteUrl : String) {
val isSafe = websiteUrl.urlVerification {
"safetorun.com".allowHost()
}
if (isSafe) {
loadUrl(websiteUrl)
}
}
mySecureFunction("https://evil-website.com")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment