Skip to content

Passing lowercase get to the sdks request method results in a curl GET request with data #217

Description

@mclark-ably

When enumerating channels via the request method with get as lowercase i.e

$page = $ably_rest->request( 'get', '/channels', [ 'limit' => 2 ] );

The first request is fired off as expected

2025-09-10 15:14:02 cURL command: 2025-09-10 15:14:02 curl -X GET -H "Authorization: Basic PGFibHktYXBpLWtleT4=" -H "Accept: application/x-msgpack" -H "X-Ably-Version: 2" -H "Ably-Agent: ably-php/1.1.10 php/8.4.8" https://rest.ably.io:443/channels?limit=2

however if there is more than one page, getting the next page with $page->next() the request is sent with data

2025-09-10 15:14:02 cURL command: 2025-09-10 15:14:02 curl -X GET --data "�" -H "Authorization: Basic PGFibHktYXBpLWtleT4=" -H "Accept: application/x-msgpack" -H "X-Ably-Version: 2" -H "Ably-Agent: ably-php/1.1.10 php/8.4.8" -H "Content-Type: application/x-msgpack" https://rest.ably.io:443/channels?limit=2&format=msgpack&keyPrefix=XNZ3Y%3A&cursor=&locationCursor=1083hxO-Q&regionCursor=108QKXKxw

This results in a 403 error from cloudfront

[body] => <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: R7Ts8-89GWGJHIDid2O8d89hXt8ItQyCBn0D8OX5Ali7xsK7gNYTkQ==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

Workaround is to make sure to pass GET as uppercase in the SDKs request method

┆Issue is synchronized with this Jira Task by Unito

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions