fix(editor): Set browser-id on all relative urls (no-changelog) (#9097)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-04-09 15:12:23 +02:00 committed by GitHub
parent cfaab0b829
commit d46635fdb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,8 +78,11 @@ export async function request(config: {
method,
url: endpoint,
baseURL,
headers,
headers: headers ?? {},
};
if (baseURL.startsWith('/') && browserId) {
options.headers!['browser-id'] = browserId;
}
if (
import.meta.env.NODE_ENV !== 'production' &&
!baseURL.includes('api.n8n.io') &&
@ -128,15 +131,11 @@ export async function makeRestApiRequest<T>(
endpoint: string,
data?: IDataObject | IDataObject[],
) {
const headers: RawAxiosRequestHeaders = { 'push-ref': context.pushRef };
if (browserId) {
headers['browser-id'] = browserId;
}
const response = await request({
method,
baseURL: context.baseUrl,
endpoint,
headers,
headers: { 'push-ref': context.pushRef },
data,
});