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

CORS requests now fail due to amz-sdk-invocation-id header #2038

Closed
activiz opened this issue Feb 16, 2021 · 5 comments · Fixed by #2041 or #3076
Closed

CORS requests now fail due to amz-sdk-invocation-id header #2038

activiz opened this issue Feb 16, 2021 · 5 comments · Fixed by #2041 or #3076
Assignees
Labels
bug This issue is a bug.

Comments

@activiz
Copy link

activiz commented Feb 16, 2021

Describe the bug

When attempting to describe a databrew dataset, I am encountering a CORS error

SDK version number

@aws-sdk/[email protected]

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

Node.js

Details of the browser/Node.js/ReactNative version

v10.19.0

Steps to reproduce

cognitoIdentityClient = new CognitoIdentityClient({ region: 'eu-west-1' });
client = new DataBrewClient({
  region: 'eu-west-1',
  credentials: fromCognitoIdentityPool({
    client: this.cognitoIdentityClient,
    identityPoolId: 'eu-west-1:xxxxxx-7583-415b-xxxx-xxxxxx'
  })
});

constructor() { }

async ngOnInit() {
  try {
    const d: DescribeDatasetRequest = { Name: 'SalesDataset' };
    const command = new DescribeDatasetCommand(d);
    const data = await this.client.send(command);
    console.log(data);
  } catch (error) {
    console.log(error);
  }
}

Observed behavior

When executing the above code, I am getting the following error:

Access to fetch at 'https://databrew.eu-west-1.amazonaws.com/datasets/SalesDataset' from origin 'https://localhost:4200' has been blocked by CORS policy: Request header field amz-sdk-invocation-id is not allowed by Access-Control-Allow-Headers in preflight response.

Expected behavior

The data should return and show me a description of the dataset I requested.

@activiz activiz added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 16, 2021
@trivikr trivikr removed the needs-triage This issue or PR still needs to be triaged. label Feb 16, 2021
@trivikr
Copy link
Member

trivikr commented Feb 16, 2021

DataBrew doesn't support retry headers in CORS: https://github.com/AllanZhengYP/cors-test/blob/master/output.md

Fix:

  • Short term: DataBrew service name needs to be added in AddOmitRetryHeadersDependency
  • Long term: Create a ticket with DataBrew service team to support retry headers.

@trivikr
Copy link
Member

trivikr commented Feb 16, 2021

Other services which don't support retry headers in CORS, and are not in AddOmitRetryHeadersDependency:

  • AppFlow
  • AppIntegrations
  • AuditManager
  • Connect Contact Lens
  • Customer Profiles
  • DevOps Guru
  • Service Catalog AppRegistry

@activiz
Copy link
Author

activiz commented Feb 20, 2021

Hi @trivikr, thank you for the new release. The bug still exists in "@aws-sdk/client-databrew": "^3.6.0".

@trivikr trivikr reopened this Feb 20, 2021
@ahmedelhaw
Copy link

any update on "@aws-sdk/client-databrew"
has been blocked by CORS policy: Request header field amz-sdk-invocation-id is not allowed by Access-Control-Allow-Headers in preflight respons

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
3 participants