aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.04k stars 571 forks source link

Polly doesn't accept multi byte text #1100

Closed tkashi closed 4 years ago

tkashi commented 4 years ago

Describe the bug When I set a multi-byte string like '2。' as a text in Polly, it produces InvalidSignatureException "The request signature we calculated does not match the signature you provided. "

SDK version number 1.0.0-beta.3

Is the issue in the browser/Node.js? Browser

Details of the browser/Node.js version Paste output of npx envinfo --browsers or node -v

Browsers: Chrome: 81.0.4044.113 Firefox: 68.6.1 Safari: 13.1

To Reproduce (observed behavior)

  1. Run the following code with a valid credential in any browser:

    import { PollyClient, SynthesizeSpeechCommand } from "@aws-sdk/client-polly";
    
    const client = new PollyClient({ region: "us-east-1", credentials: credential });
    const synthesizeSpeechCommand = new SynthesizeSpeechCommand({
        OutputFormat: 'mp3',
        Text: '2。',
        VoiceId: 'Mizuki',
        TextType: 'text',
        SampleRate: '24000'
    });
    client.send(synthesizeSpeechCommand);

The final line client.send produces the error.

Expected behavior This request should get a response with a suitable audio stream.

Screenshots

Screen Shot 2020-04-20 at 9 49 21 Screen Shot 2020-04-20 at 9 48 51

(sdk v2 is just for getting credentials...)

Additional context The similar fix is required as in #183 for Node.js.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.