Also look for travis.org as well as .com

This commit is contained in:
Tom Parker-Shemilt 2020-01-20 18:05:20 +00:00
parent f0af98f3fc
commit dec99f4416

View file

@ -121,7 +121,7 @@ fn get_url(url: String) -> BoxFuture<'static, (String, Result<String, CheckerErr
} }
} }
lazy_static! { lazy_static! {
static ref TRAVIS_IMG_REGEX: Regex = Regex::new(r"https://api.travis-ci.com/[^/]+/.+\.svg").unwrap(); static ref TRAVIS_IMG_REGEX: Regex = Regex::new(r"https://api.travis-ci.(?:com|org)/[^/]+/.+\.svg").unwrap();
} }
if TRAVIS_IMG_REGEX.is_match(&url) { if TRAVIS_IMG_REGEX.is_match(&url) {
let content_dispostion = ok.headers().get(header::CONTENT_DISPOSITION).and_then(|h| h.to_str().ok()).unwrap_or(""); let content_dispostion = ok.headers().get(header::CONTENT_DISPOSITION).and_then(|h| h.to_str().ok()).unwrap_or("");