Krug.ImageUtil (Krug v2.0.27) View Source
Utilitary module to work with images.
Link to this section Summary
Functions
Validates a url relative to a image stored in cloud.
Link to this section Functions
Validates a url relative to a image stored in cloud.
Should be an HTTPS
link and the image should be of type: ["png","bmp","jpg","jpeg","gif"]
.
Useful to block the use of images that don't are serverd over https protocol and could break application security.
Examples
iex > url = "www.google.com"
iex > Krug.ImageUtil.validate_url(url)
false
iex > url = "http://www.google.com"
iex > Krug.ImageUtil.validate_url(url)
false
iex > url = "https://www.google.com.br"
iex > Krug.ImageUtil.validate_url(url)
false
iex > url = "https://www.google.com.png"
iex > Krug.ImageUtil.validate_url(url)
true
iex > url = "https://www.google.com.gif"
iex > Krug.ImageUtil.validate_url(url)
true