diff options
author | Vika <vika@fireburn.ru> | 2024-08-18 01:14:11 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-08-18 01:14:11 +0300 |
commit | db0ccc5b8c6305e63a92e577b62703331b01d363 (patch) | |
tree | 5e3d8785d1b143596acba14313692db7ed29d874 /src | |
parent | b32ed9ce706650f9e71aa74eb0e26e333215e0e3 (diff) | |
download | kittybox-db0ccc5b8c6305e63a92e577b62703331b01d363.tar.zst |
Better match html content-type
Diffstat (limited to 'src')
-rw-r--r-- | src/indieauth/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<A: AuthBackend, D: Storage + 'static>( 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::<ContentType>() == Some(ContentType::html()) => { + Ok(response) if response.headers().typed_get::<ContentType>().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()); |