From db0ccc5b8c6305e63a92e577b62703331b01d363 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 18 Aug 2024 01:14:11 +0300 Subject: Better match html content-type --- src/indieauth/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/indieauth/mod.rs b/src/indieauth/mod.rs index f7a9712..ba19b3b 100644 --- a/src/indieauth/mod.rs +++ b/src/indieauth/mod.rs @@ -149,7 +149,7 @@ async fn authorization_endpoint_get( let metadata_request = http.get(request.client_id.clone()) .header("Accept", "application/json, text/html"); match metadata_request.send().await.and_then(|res| res.error_for_status()) { - Ok(response) if response.headers().typed_get::() == Some(ContentType::html()) => { + Ok(response) if response.headers().typed_get::().to_owned().map(mime::Mime::from).map(|m| m.type_() == "text" && m.subtype() == "html").unwrap_or(false) => { let url = response.url().clone(); let text = response.text().await.unwrap(); tracing::debug!("Received {} bytes in response", text.len()); -- cgit 1.4.1