Skip to content

Commit

Permalink
fix: missing protocol
Browse files Browse the repository at this point in the history
fixes #1218
  • Loading branch information
willfarrell committed Jun 18, 2024
1 parent 145643e commit 8bef7ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ws-response/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test.serial('It should post when api gateway event', async (t) => {

const event = {
requestContext: {
domainName: 'https://xxxxxx.execute-api.region.amazonaws.com',
domainName: 'xxxxxx.execute-api.region.amazonaws.com',
stage: 'production',
connectionId: 'id'
}
Expand All @@ -64,7 +64,7 @@ test.serial('It should post when endpoint option set', async (t) => {
wsResponse({
AwsClient: ApiGatewayManagementApiClient,
awsClientOptions: {
endpoint: 'https://xxxxxx.execute-api.region.amazonaws.com/production'
endpoint: 'xxxxxx.execute-api.region.amazonaws.com/production'
}
})
)
Expand Down
1 change: 1 addition & 0 deletions packages/ws-response/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const wsResponseMiddleware = (opts) => {

if (!options.awsClientOptions.endpoint && request.event.requestContext) {
options.awsClientOptions.endpoint =
'https://' +
request.event.requestContext.domainName +
'/' +
request.event.requestContext.stage
Expand Down

0 comments on commit 8bef7ac

Please sign in to comment.