mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Set browser-id
on all relative urls (no-changelog) (#9097)
This commit is contained in:
parent
cfaab0b829
commit
d46635fdb9
|
@ -78,8 +78,11 @@ export async function request(config: {
|
||||||
method,
|
method,
|
||||||
url: endpoint,
|
url: endpoint,
|
||||||
baseURL,
|
baseURL,
|
||||||
headers,
|
headers: headers ?? {},
|
||||||
};
|
};
|
||||||
|
if (baseURL.startsWith('/') && browserId) {
|
||||||
|
options.headers!['browser-id'] = browserId;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
import.meta.env.NODE_ENV !== 'production' &&
|
import.meta.env.NODE_ENV !== 'production' &&
|
||||||
!baseURL.includes('api.n8n.io') &&
|
!baseURL.includes('api.n8n.io') &&
|
||||||
|
@ -128,15 +131,11 @@ export async function makeRestApiRequest<T>(
|
||||||
endpoint: string,
|
endpoint: string,
|
||||||
data?: IDataObject | IDataObject[],
|
data?: IDataObject | IDataObject[],
|
||||||
) {
|
) {
|
||||||
const headers: RawAxiosRequestHeaders = { 'push-ref': context.pushRef };
|
|
||||||
if (browserId) {
|
|
||||||
headers['browser-id'] = browserId;
|
|
||||||
}
|
|
||||||
const response = await request({
|
const response = await request({
|
||||||
method,
|
method,
|
||||||
baseURL: context.baseUrl,
|
baseURL: context.baseUrl,
|
||||||
endpoint,
|
endpoint,
|
||||||
headers,
|
headers: { 'push-ref': context.pushRef },
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue