Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
greg-md opened this issue Jun 24, 2024 · 2 comments
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@greg-md
Copy link

greg-md commented Jun 24, 2024

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.

@jyotisaini jyotisaini added the SDK Issue pertains to the SDK itself and not specific to any service label Aug 5, 2024
@jyotisaini
Copy link
Contributor

@y-chandra Can you check if we url encode query params in the typescript SDK. AFAIR we do encode them.

@greg-md
Copy link
Author

greg-md commented Aug 6, 2024

@jyotisaini I have checked the sdk source code before writing this issue and the query params were not url encoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

2 participants