Update webfinger and reqwest
Update webfinger to 0.3.1 Update reqwest to 0.9 Fix #257
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
use activitypub::{Actor, Object, CustomObject, actor::Group, collection::OrderedCollection};
|
||||
use chrono::NaiveDateTime;
|
||||
use reqwest::{
|
||||
Client,
|
||||
header::{Accept, qitem},
|
||||
mime::Mime
|
||||
use reqwest::{Client,
|
||||
header::{ACCEPT, HeaderValue}
|
||||
};
|
||||
use serde_json;
|
||||
use url::Url;
|
||||
@@ -120,7 +118,7 @@ impl Blog {
|
||||
fn fetch_from_url(conn: &Connection, url: String) -> Option<Blog> {
|
||||
let req = Client::new()
|
||||
.get(&url[..])
|
||||
.header(Accept(ap_accept_header().into_iter().map(|h| qitem(h.parse::<Mime>().expect("Invalid Content-Type"))).collect()))
|
||||
.header(ACCEPT, HeaderValue::from_str(&ap_accept_header().into_iter().collect::<Vec<_>>().join(", ")).unwrap())
|
||||
.send();
|
||||
match req {
|
||||
Ok(mut res) => {
|
||||
|
||||
@@ -20,8 +20,7 @@ use plume_common::activity_pub::{
|
||||
};
|
||||
use reqwest::{
|
||||
Client,
|
||||
header::{Accept, qitem},
|
||||
mime::Mime
|
||||
header::{ACCEPT, HeaderValue}
|
||||
};
|
||||
use rocket::{
|
||||
request::{self, FromRequest, Request},
|
||||
@@ -192,7 +191,7 @@ impl User {
|
||||
fn fetch(url: String) -> Option<CustomPerson> {
|
||||
let req = Client::new()
|
||||
.get(&url[..])
|
||||
.header(Accept(ap_accept_header().into_iter().map(|h| qitem(h.parse::<Mime>().expect("Invalid Content-Type"))).collect()))
|
||||
.header(ACCEPT, HeaderValue::from_str(&ap_accept_header().into_iter().collect::<Vec<_>>().join(", ")).unwrap())
|
||||
.send();
|
||||
match req {
|
||||
Ok(mut res) => {
|
||||
@@ -348,7 +347,7 @@ impl User {
|
||||
pub fn fetch_outbox<T: Activity>(&self) -> Vec<T> {
|
||||
let req = Client::new()
|
||||
.get(&self.outbox_url[..])
|
||||
.header(Accept(ap_accept_header().into_iter().map(|h| qitem(h.parse::<Mime>().expect("Invalid Content-Type"))).collect()))
|
||||
.header(ACCEPT, HeaderValue::from_str(&ap_accept_header().into_iter().collect::<Vec<_>>().join(", ")).unwrap())
|
||||
.send();
|
||||
match req {
|
||||
Ok(mut res) => {
|
||||
@@ -370,7 +369,7 @@ impl User {
|
||||
pub fn fetch_followers_ids(&self) -> Vec<String> {
|
||||
let req = Client::new()
|
||||
.get(&self.followers_endpoint[..])
|
||||
.header(Accept(ap_accept_header().into_iter().map(|h| qitem(h.parse::<Mime>().expect("Invalid Content-Type"))).collect()))
|
||||
.header(ACCEPT, HeaderValue::from_str(&ap_accept_header().into_iter().collect::<Vec<_>>().join(", ")).unwrap())
|
||||
.send();
|
||||
match req {
|
||||
Ok(mut res) => {
|
||||
|
||||
Reference in New Issue
Block a user