graphql-mesh
graphql-mesh copied to clipboard
curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [ ] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
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
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.