TTLabs / EvaporateJS

Javascript library for browser to S3 multipart resumable uploads
1.82k stars 206 forks source link

AWS Failed to execute 'setRequestHeader' on 'XMLHttpRequest' #392

Closed lukasborawski closed 6 years ago

lukasborawski commented 6 years ago

I'm using the Evaporate (https://github.com/TTLabs/EvaporateJS) to upload my files to S3. The app is in Vue/Nuxt.js setup, and this is my config:

    const uploadApiConfig = {
        signerUrl: '/api/sign_auth',
        awsRegion: process.env.awsRegion,
        aws_key: process.env.awsKey,
        bucket: process.env.awsBucket,
        computeContentMd5: true,
        awsSignatureVersion: '4',
        cryptoMd5Method: (data) => {
            return AWS.util.crypto.md5(data, 'base64')
        },
        cryptoHexEncodedHash256: (data) => {
            return AWS.util.crypto.sha256(data, 'hex')
        },
        signHeaders: {
            'authorization': `Bearer ${token}`
        }
    }

but still get this error Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'AWS4-HMAC-SHA256 Credential=.../s3/aws4_request, SignedHeaders=host;x-amz-date Anyone can help?

lukasborawski commented 6 years ago

The problem was with API url. Closing.