summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-06-12 17:51:37 -0400
committerDessalines <tyhou13@gmx.com>2020-06-12 17:51:37 -0400
commit5594bed6a8832b3fcba48966752cf0d5859cf1d4 (patch)
tree5b2d6ecaad4937b0c1ad35dfad397f4b83f50a37 /server/src
parentf647f2ae6cb187be08c6fd0f7daeb51e4093145a (diff)
parent7cb7c1f0f9a77c3019200edffa5381f8a4d76e55 (diff)
Merge branch 'master' into use-pictrs-1
Diffstat (limited to 'server/src')
-rw-r--r--server/src/lib.rs8
-rw-r--r--server/src/version.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs
index 9b73caa8..49971cfa 100644
--- a/server/src/lib.rs
+++ b/server/src/lib.rs
@@ -36,7 +36,6 @@ pub mod websocket;
use actix_web::dev::ConnectionInfo;
use chrono::{DateTime, NaiveDateTime, Utc};
-use isahc::prelude::*;
use lettre::smtp::authentication::{Credentials, Mechanism};
use lettre::smtp::extension::ClientId;
use lettre::smtp::ConnectionReuseParameters;
@@ -74,7 +73,8 @@ pub fn is_email_regex(test: &str) -> bool {
}
pub fn is_image_content_type(test: &str) -> Result<(), failure::Error> {
- if isahc::get(test)?
+ if attohttpc::get(test)
+ .send()?
.headers()
.get("Content-Type")
.ok_or_else(|| format_err!("No Content-Type header"))?
@@ -182,7 +182,7 @@ pub struct IframelyResponse {
pub fn fetch_iframely(url: &str) -> Result<IframelyResponse, failure::Error> {
let fetch_url = format!("http://iframely/oembed?url={}", url);
- let text = isahc::get(&fetch_url)?.text()?;
+ let text: String = attohttpc::get(&fetch_url).send()?.text()?;
let res: IframelyResponse = serde_json::from_str(&text)?;
Ok(res)
}
@@ -206,7 +206,7 @@ pub fn fetch_pictrs(image_url: &str) -> Result<PictrsResponse, failure::Error> {
"http://pictrs:8080/image/download?url={}",
utf8_percent_encode(image_url, NON_ALPHANUMERIC) // TODO this might not be needed
);
- let text = isahc::get(&fetch_url)?.text()?;
+ let text = attohttpc::get(&fetch_url).send()?.text()?;
let res: PictrsResponse = serde_json::from_str(&text)?;
if res.msg == "ok" {
Ok(res)
diff --git a/server/src/version.rs b/server/src/version.rs
index 354b86b4..529e3bff 100644
--- a/server/src/version.rs
+++ b/server/src/version.rs
@@ -1 +1 @@
-pub const VERSION: &str = "v0.6.71";
+pub const VERSION: &str = "v0.6.74";