diff --git a/packages/builder-util-runtime/src/httpExecutor.ts b/packages/builder-util-runtime/src/httpExecutor.ts index 5d75cd6bcd..33a40db4f2 100644 --- a/packages/builder-util-runtime/src/httpExecutor.ts +++ b/packages/builder-util-runtime/src/httpExecutor.ts @@ -449,11 +449,9 @@ export function configureRequestOptions(options: RequestOptions, token?: string options.method = method } - let headers = options.headers - if (headers == null) { - headers = {} - options.headers = headers - } + options.headers = {...options.headers} + const headers = options.headers + if (token != null) { (headers as any).authorization = token.startsWith("Basic") ? token : `token ${token}` }