Skip to content

Add Content-Length header to GraphQL requests to comply with Shopify API changes #347

@shevabam

Description

@shevabam

Shopify just announced that starting August 1st, every POST request to its API must include either the Content-Length header or use Transfer-Encoding: chunked.

https://shopify.dev/changelog/deprecation-of-post-requests-without-a-content-length-or-transfer-encoding-chunked-header

In lib/HttpRequestJson.php, within the prepareRequest() method, the header is already present — so REST API requests are compliant.

However, for GraphQL requests, it seems the equivalent header (self::$httpHeaders['Content-Length'] = strlen(self::$postDataJSON);) is missing in lib/HttpRequestGraphQL.php, in the prepareRequest() method.

Metadata

Metadata

Assignees

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