fix: truncate remote actor username to VARCHAR(32); fix outbox URL by following 'first' link
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m33s
test / unit (pull_request) Failing after 10m46s
test / integration (pull_request) Failing after 16m54s
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m33s
test / unit (pull_request) Failing after 10m46s
test / integration (pull_request) Failing after 16m54s
This commit is contained in:
@@ -1528,8 +1528,26 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
||||
) -> Result<Vec<domain::models::remote_note::RemoteNote>, domain::errors::DomainError> {
|
||||
use chrono::DateTime;
|
||||
|
||||
let url = format!("{}?page={}", outbox_url, page);
|
||||
let resp: serde_json::Value = reqwest::Client::new()
|
||||
// Fetch the base outbox to find the real first-page URL.
|
||||
// Mastodon uses ?page=true; other servers may use ?page=1 or a different param.
|
||||
let client = reqwest::Client::new();
|
||||
let base: serde_json::Value = client
|
||||
.get(outbox_url)
|
||||
.header("Accept", "application/activity+json, application/ld+json")
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))?
|
||||
.json()
|
||||
.await
|
||||
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))?;
|
||||
|
||||
// Prefer the `first` link from the OrderedCollection; fall back to ?page=1.
|
||||
let url = base["first"]
|
||||
.as_str()
|
||||
.map(|s| s.to_string())
|
||||
.unwrap_or_else(|| format!("{}?page={}", outbox_url, page));
|
||||
|
||||
let resp: serde_json::Value = client
|
||||
.get(&url)
|
||||
.header("Accept", "application/activity+json, application/ld+json")
|
||||
.send()
|
||||
|
||||
Reference in New Issue
Block a user