fix: fetcher specifies application/json

This commit is contained in:
əlemi 2024-04-13 04:21:33 +02:00
parent 2031d8de41
commit 1caaa08f78
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -1,6 +1,6 @@
use base64::Engine; use base64::Engine;
use openssl::{hash::MessageDigest, pkey::{PKey, Private}, sign::Signer}; use openssl::{hash::MessageDigest, pkey::{PKey, Private}, sign::Signer};
use reqwest::{header::{CONTENT_TYPE, USER_AGENT}, Method, Response}; use reqwest::{header::{ACCEPT, CONTENT_TYPE, USER_AGENT}, Method, Response};
use sea_orm::{DatabaseConnection, EntityTrait, IntoActiveModel}; use sea_orm::{DatabaseConnection, EntityTrait, IntoActiveModel};
use crate::{model, VERSION}; use crate::{model, VERSION};
@ -37,6 +37,7 @@ impl Fetcher {
let mut client = reqwest::Client::new() let mut client = reqwest::Client::new()
.request(method, url) .request(method, url)
.header(ACCEPT, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"")
.header(CONTENT_TYPE, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") .header(CONTENT_TYPE, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"")
.header(USER_AGENT, format!("upub+{VERSION} ({domain})")) .header(USER_AGENT, format!("upub+{VERSION} ({domain})"))
.header("Host", host.clone()) .header("Host", host.clone())