graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding

Open jmou opened this issue 11 months ago • 1 comments

Issue workflow progress

Progress of the issue based on the Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • [ ] 2. A failing test has been provided
  • [ ] 3. A local solution has been provided
  • [ ] 4. A pull request is pending review

Describe the bug

I am using the OpenAPI source handler. It appears that any response headers from the REST API are then included in the GraphQL response. When the REST response includes a 'Transfer-Encoding: chunked' header, the actual response body is not still chunked, which is then an invalid HTTP response.

To Reproduce Steps to reproduce the behavior:

I just have a simple OpenAPI source handler configured. My REST endpoint in some cases returns a response with a chunked transfer encoding. curl will emit the error "(56) Illegal or missing hexadecimal sequence in chunked-encoding", and Chrome Dev Tools will not show a response body when making requests to the Mesh server.

Expected behavior

The Transfer-Encoding header should be stripped from the response. Honestly I think all headers (like Set-Cookie, Connection) should be stripped, because they generally only pertain to the REST server response itself.

Environment:

  • OS: Linux
  • @graphql-mesh/...: 0.95.0
  • NodeJS: v18.16.1

Additional context

jmou avatar Jul 29 '23 00:07 jmou

Hmm GraphQL Mesh doesn't forward the response headers. If it does, this is a bug. Could you create a reproduction on CodeSandbox or Stackblitz? Maybe you can help us to reproduce it in the repo.

ardatan avatar Aug 03 '23 15:08 ardatan