Skip to content

EmailClient -> listSuppressions doesn't url encode email special characters in requestEndpoint #291

Open
@greg-md

Description

@greg-md

Hello,

When an email address contains special characters like +, the request fails with 400 invalid email parameter error:

statusCode: 400,
serviceCode: 'InvalidParameter',
opcRequestId: '43FCB4E031F8-11EF-8CD1-BF8CE55FC/2B6CD7C119E2429B8D904913FEAEF72E/95DB72DF682D438C8464F14B2370B445',
targetService: 'Email',
operationName: 'listSuppressions',
timestamp: '2024-06-24T07:06:23.407Z',
requestEndpoint: 'GET https://ctrl.email.us-phoenix-1.oci.oraclecloud.com/20170907/suppressions?compartmentId=ocid1.tenancy.oc1..aaaaaaaa3wam7rmtqbw7nktj6vd6pagns43c2afnohud6swc7dehqrbzolva&[email protected]',
clientVersion: 'Oracle-TypeScriptSDK/2.81.0',

Based on requestEndpoint from the log, seems like the email was not url encoded, so I had to manually url encode email address before calling the SDK:

const client = new EmailClient({ authenticationDetailsProvider: provider });
const listSuppressionsResponse = await client.listSuppressions({
    compartmentId: provider.getTenantId(),
    emailAddress: encodeURIComponent(email),
});

But it would be good if SDK will url encode query parameters by itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SDKIssue pertains to the SDK itself and not specific to any service

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions