[][src]Function clean_url::return_url

pub async fn return_url(url: String, is_secure: bool) -> Option<String>

Returns a clean URL that has a 200 series status code

Usage:

use clean_url::return_url;
use tokio_test::block_on;

assert_eq!(block_on(return_url(String::from("https://httpbin.org/status/200"), false)), Some(String::from("https://httpbin.org/status/200")));
assert_eq!(block_on(return_url(String::from("example.com"), false)), Some(String::from("http://example.com/")));
assert_eq!(block_on(return_url(String::from("example.com"), true)), Some(String::from("https://example.com/")));