Solve theoretical bug in forwardRequestSigner

resolves #4611
This commit is contained in:
timothycarambat 2025-11-20 18:36:10 -08:00
parent 1e2d4ff51a
commit 4ec85418c4

View File

@ -179,12 +179,13 @@ class CollectorApi {
// all requests through the server. You can use this function to directly expose a specific endpoint
// on the document processor.
async forwardExtensionRequest({ endpoint, method, body }) {
const data = typeof body === "string" ? body : JSON.stringify(body);
return await fetch(`${this.endpoint}${endpoint}`, {
method,
body, // Stringified JSON!
body: data,
headers: {
"Content-Type": "application/json",
"X-Integrity": this.comkey.sign(body),
"X-Integrity": this.comkey.sign(data),
"X-Payload-Signer": this.comkey.encrypt(
new EncryptionManager().xPayload
),