Accept more content types when making AP requests
This commit is contained in:
@@ -18,7 +18,7 @@ use webfinger::*;
|
||||
|
||||
use {BASE_URL, USE_HTTPS};
|
||||
use plume_common::activity_pub::{
|
||||
ApSignature, ActivityStream, Id, IntoId, PublicKey,
|
||||
AP_ACCEPT_HEADER, ApSignature, ActivityStream, Id, IntoId, PublicKey,
|
||||
inbox::WithInbox,
|
||||
sign
|
||||
};
|
||||
@@ -109,7 +109,7 @@ impl Blog {
|
||||
fn fetch_from_url(conn: &PgConnection, url: String) -> Option<Blog> {
|
||||
let req = Client::new()
|
||||
.get(&url[..])
|
||||
.header(Accept(vec![qitem("application/activity+json".parse::<Mime>().unwrap())]))
|
||||
.header(Accept(vec![qitem(AP_ACCEPT_HEADER.parse::<Mime>().unwrap())]))
|
||||
.send();
|
||||
match req {
|
||||
Ok(mut res) => {
|
||||
|
||||
@@ -13,7 +13,7 @@ use openssl::{
|
||||
sign
|
||||
};
|
||||
use plume_common::activity_pub::{
|
||||
ActivityStream, Id, IntoId, ApSignature, PublicKey,
|
||||
AP_ACCEPT_HEADER, ActivityStream, Id, IntoId, ApSignature, PublicKey,
|
||||
inbox::WithInbox,
|
||||
sign::{Signer, gen_keypair}
|
||||
};
|
||||
@@ -155,7 +155,7 @@ impl User {
|
||||
fn fetch_from_url(conn: &PgConnection, url: String) -> Option<User> {
|
||||
let req = Client::new()
|
||||
.get(&url[..])
|
||||
.header(Accept(vec![qitem("application/activity+json".parse::<Mime>().unwrap())]))
|
||||
.header(Accept(vec![qitem(AP_ACCEPT_HEADER.parse::<Mime>().unwrap())]))
|
||||
.send();
|
||||
match req {
|
||||
Ok(mut res) => {
|
||||
|
||||
Reference in New Issue
Block a user