mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(AwsS3 Node): Use location constrain (#8654)
This commit is contained in:
@@ -284,7 +284,13 @@ export class Aws implements ICredentialType {
|
||||
let path = requestOptions.qs?.path;
|
||||
const method = requestOptions.method;
|
||||
let body = requestOptions.body;
|
||||
|
||||
let region = credentials.region;
|
||||
if (requestOptions.qs?._region) {
|
||||
region = requestOptions.qs._region as string;
|
||||
delete requestOptions.qs._region;
|
||||
}
|
||||
|
||||
let query = requestOptions.qs?.query as IDataObject;
|
||||
// ! Workaround as we still use the IRequestOptions interface which uses uri instead of url
|
||||
// ! To change when we replace the interface with IHttpRequestOptions
|
||||
@@ -324,10 +330,10 @@ export class Aws implements ICredentialType {
|
||||
} else if (service === 'sqs' && credentials.sqsEndpoint) {
|
||||
endpointString = credentials.sqsEndpoint as string;
|
||||
} else if (service) {
|
||||
endpointString = `https://${service}.${credentials.region}.amazonaws.com`;
|
||||
endpointString = `https://${service}.${region}.amazonaws.com`;
|
||||
}
|
||||
endpoint = new URL(
|
||||
endpointString!.replace('{region}', credentials.region as string) + (path as string),
|
||||
endpointString!.replace('{region}', region as string) + (path as string),
|
||||
);
|
||||
} else {
|
||||
// If no endpoint is set, we try to decompose the path and use the default endpoint
|
||||
|
||||
@@ -29,12 +29,14 @@ export async function awsApiRequest(
|
||||
service,
|
||||
path,
|
||||
query,
|
||||
_region,
|
||||
},
|
||||
method,
|
||||
body,
|
||||
url: '',
|
||||
headers,
|
||||
} as IHttpRequestOptions;
|
||||
|
||||
if (Object.keys(option).length !== 0) {
|
||||
Object.assign(requestOptions, option);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user