mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -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,
|
||||
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,
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue