Aws-sdk-php: ApiGatewayManagementApiClient: Endpoint stage gets removed from URI

Created on 20 Feb 2019  路  3Comments  路  Source: aws/aws-sdk-php

Problem
For websocket API calls that use stages the path gets removed from the URI resulting in something like this:
https://xxxxx.execute-api.us-east-1.amazonaws.com/dev/@connections/yyyyy
becoming:
https://xxxxx.execute-api.us-east-1.amazonaws.com/@connections/yyyyy
And thus a client forbidden error is thrown.

Solution
Two things must be set for the guzzlehttp resolver to properly blend the paths together.

  1. The endpoint specified in the ApiGatewayManagementApiClient call must have the trailing slash. IE:
    https://xxxxx.execute-api.us-east-1.amazonaws.com/dev/
  2. The leading slash here needs to be removed:
    https://github.com/aws/aws-sdk-php/blob/1d442bd93d3648e403ab895b5e1f464b4aa1b376/src/data/apigatewaymanagementapi/2018-11-29/api-2.json#L18

thus becoming:
"requestUri" : "@connections/{connectionId}",
I'm happy to do a PR for the one character removal if you want.

bug service-api

Most helpful comment

Is there a status update on this? The reporter of this issue has suggested a very simple fix. Please get this done, as it breaks the PHP SDK for web sockets. We obviously can patch it, but if there is a need to adhere to your internal process, that process shouldn鈥檛 take a 2 minute issue and turn it into one that takes two months.

All 3 comments

Hi @papacarp, thanks for reaching out to us about this. Unfortunately we won't be able to accept a PR for this change since the API model in the file you mention is provided by the API Gateway team; any update that gets pushed to this file from their end would overwrite this change.

I've reached out to the service team about having this change made to the API model from their end, once I have additional information I'll update the issue accordingly.

Is there a status update on this? The reporter of this issue has suggested a very simple fix. Please get this done, as it breaks the PHP SDK for web sockets. We obviously can patch it, but if there is a need to adhere to your internal process, that process shouldn鈥檛 take a 2 minute issue and turn it into one that takes two months.

A fix for this issue has been merged. It will be fixed with the next release.

Was this page helpful?
0 / 5 - 0 ratings