Skip to content

Commit

Permalink
set browser-id header only on api requests, and not on external requests
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Apr 8, 2024
1 parent 27d6cd9 commit 30880fa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/editor-ui/src/utils/apiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ export async function request(config: {
method,
url: endpoint,
baseURL,
headers: headers ?? {},
headers,
};
if (browserId) {
options.headers!['browser-id'] = browserId;
}
if (
import.meta.env.NODE_ENV !== 'production' &&
!baseURL.includes('api.n8n.io') &&
Expand Down Expand Up @@ -131,11 +128,15 @@ 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: { 'push-ref': context.pushRef },
headers,
data,
});

Expand Down

0 comments on commit 30880fa

Please sign in to comment.