aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 557 forks source link

client use http protocol failed #6106

Open uzengo opened 1 month ago

uzengo commented 1 month ago

Checkboxes for prior research

Describe the bug

our client code

        s3Client = new S3({
          region: 'xx',
          endpoint: 'http://abc.com:',
          disableHostPrefix: true,
          tls: false,
          credentials: {
            accessKeyId: accessKey,
            secretAccessKey: accessSecret,
            sessionToken: accessToken,
          },
        });

 const uploadParams = {
        Bucket: bucket,
        Key: halfPath,
        Body: file, // file from <input type="file">
      };
      const upload = new Upload({
        client: s3Client,
        params: uploadParams,
        queueSize: 4, // optional concurrency configuration
        partSize: 1024 * 1024 * 5, // optional size of each part
        leavePartsOnError: false, // optional manually handle dropped parts
      });
      console.log('==>zzzz11');

      upload.on('httpUploadProgress', (progress) => {
        console.log('==>progress', progress);
      });
      try {
        await upload.done();
      } catch (err) {
        console.log('==>444', err);
      }

when we use this code, our endpoint change to https, the config is no work!!!

image

SDK version number

"@aws-sdk/client-s3": "3.577.0" "@aws-sdk/lib-storage": "3.578.0"

Which JavaScript Runtime is this issue in?

React Native

Details of the browser/Node.js/ReactNative version

v16.18.0

Reproduction Steps

see code

Observed Behavior

change url protocol from http to https

Expected Behavior

use http endpoint

Possible Solution

No response

Additional Information/Context

No response