aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.05k stars 574 forks source link

Expose HTTP response headers in websocket upgrade request #6221

Closed esauerbo closed 2 months ago

esauerbo commented 3 months ago

Describe the feature

It would be helpful to have access to the response headers in the initial http upgrade request for a websocket connection. We are specifically looking to access the date. From the below screenshots you can see the headers in the network tab but not when logging the response.

Screenshot 2024-06-13 at 10 04 49 AM Screenshot 2024-06-13 at 10 05 01 AM

Use Case

The Amplify UI Face Liveness Detector provides a UI component for Amazon Rekognition Face Liveness using the client-rekognitionstreaming package. Some customers are getting Invalid Signature Exceptions due to clock skew issues.

We want to fix this by catching these exceptions and attempting to restart the session with a systemClockOffset that's the difference between device and server time. This has been implemented on the android liveness component, but currently isn't possible in web because we cannot access the http upgrade headers.

Proposed Solution

No response

Other Information

No response

Acknowledgements

SDK version used

V3

Environment details (OS name and version, etc.)

any

kuhe commented 3 months ago

there doesn't seem to be a way to retrieve upgrade response headers in a browser using the WebSocket class.

github-actions[bot] commented 2 months 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.