HTTP requests identify Faceclaw in their user-agent string

This commit is contained in:
James Babcock committed 2026-08-20 11:32:50 -07:00
1 parent c27dcacfee
commit 8cdee2a701
14 files changed
+115 -9

No files matched your search

+2 -1
View File
@@ -7,6 +7,7 @@
*/
import { Application } from "@nativescript/core";
import { evenHubEmailSetting, evenHubPasswordSetting, hasEvenHubCredentials } from "./credentials";
import { fetchWithUserAgent } from "../../util/http";
declare const android: any;
@@ -325,7 +326,7 @@ async function fetchWithTimeout(url: string, init: RequestInit, timeoutMs = REQU
timeoutHandle = setTimeout(() => reject(new Error("EvenHub request timed out.")), timeoutMs);
});
try {
return await Promise.race([fetch(url, init), timeout]);
return await Promise.race([fetchWithUserAgent(url, init), timeout]);
} finally {
if (timeoutHandle) clearTimeout(timeoutHandle);
}
+2 -1
View File
@@ -1,4 +1,5 @@
import { Application } from "@nativescript/core";
import { fetchWithUserAgent } from "../../util/http";
declare const android: any;
declare const androidx: any;
@@ -74,7 +75,7 @@ async function downloadAndOpenPdf(url: string, appName: string, activity: any):
});
let response: Response;
try {
response = await Promise.race([fetch(url), timeout]);
response = await Promise.race([fetchWithUserAgent(url), timeout]);
} finally {
if (timeoutHandle) clearTimeout(timeoutHandle);
}
+2 -1
View File
@@ -6,6 +6,7 @@
* worker via fetch.
*/
import { roamApiTokenSetting, roamGraphNameSetting } from "../../ui/dashboard-settings";
import { fetchWithUserAgent } from "../../util/http";
const API_BASE = "https://api.roamresearch.com";
const FETCH_TIMEOUT_MS = 12_000;
@@ -145,7 +146,7 @@ async function roamPost(endpoint: "q" | "pull" | "write", body: object): Promise
async function fetchWithTimeout(url: string, payload: string, token: string): Promise<Response> {
let timeoutHandle: ReturnType<typeof setTimeout> | null = null;
const request = fetch(url, {
const request = fetchWithUserAgent(url, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",