mirror of
https://git.asonix.dog/asonix/relay.git
synced 2024-11-22 01:21:06 +00:00
Don't validate content type on response, pleromo is weird
This commit is contained in:
parent
c499b5355c
commit
c4b4f13fa6
2 changed files with 7 additions and 4 deletions
|
@ -41,7 +41,7 @@ impl QueryInstance {
|
|||
.await?;
|
||||
|
||||
let description = if instance.description.is_empty() {
|
||||
instance.short_description
|
||||
instance.short_description.unwrap_or(String::new())
|
||||
} else {
|
||||
instance.description
|
||||
};
|
||||
|
@ -102,7 +102,7 @@ impl ActixJob for QueryInstance {
|
|||
#[derive(serde::Deserialize)]
|
||||
struct Instance {
|
||||
title: String,
|
||||
short_description: String,
|
||||
short_description: Option<String>,
|
||||
description: String,
|
||||
version: String,
|
||||
registrations: bool,
|
||||
|
|
|
@ -110,9 +110,12 @@ impl Requests {
|
|||
return Err(MyError::Status(res.status()));
|
||||
}
|
||||
|
||||
res.json()
|
||||
let body = res
|
||||
.body()
|
||||
.await
|
||||
.map_err(|e| MyError::ReceiveResponse(url.to_string(), e.to_string()))
|
||||
.map_err(|e| MyError::ReceiveResponse(url.to_string(), e.to_string()))?;
|
||||
|
||||
Ok(serde_json::from_slice(body.as_ref())?)
|
||||
}
|
||||
|
||||
pub async fn fetch_bytes(&self, url: &str) -> Result<(String, Bytes), MyError> {
|
||||
|
|
Loading…
Reference in a new issue