spot: add acc key

This commit is contained in:
nick-delirium 2024-09-20 17:51:52 +02:00
parent cff1e4801b
commit d3f3b613ab
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -68,6 +68,7 @@ const sensitiveParams = new Set([
"auth", "auth",
"proxy-authorization", "proxy-authorization",
"set-cookie", "set-cookie",
"account_key",
]); ]);
function filterHeaders(headers: Record<string, string>) { function filterHeaders(headers: Record<string, string>) {
@ -105,7 +106,7 @@ function filterBody(body: any) {
parsedBody = JSON.parse(body); parsedBody = JSON.parse(body);
isJSON = true; isJSON = true;
} catch (e) { } catch (e) {
// not json // not json
} }
if (isJSON) { if (isJSON) {
@ -140,7 +141,7 @@ function obscureSensitiveData(obj: Record<string, any> | any[]) {
} }
function tryFilterUrl(url: string) { function tryFilterUrl(url: string) {
if (!url) return '' if (!url) return "";
try { try {
const urlObj = new URL(url); const urlObj = new URL(url);
if (urlObj.searchParams) { if (urlObj.searchParams) {
@ -194,10 +195,10 @@ export function createSpotNetworkRequest(
let body; let body;
if (trackedRequest.reqBody) { if (trackedRequest.reqBody) {
try { try {
body = filterBody(trackedRequest.reqBody) body = filterBody(trackedRequest.reqBody);
} catch (e) { } catch (e) {
body = "Error parsing body"; body = "Error parsing body";
console.error(e) console.error(e);
} }
} else { } else {
body = ""; body = "";