Skip to content

Add support for Transfer-Encoding Chunked #10

@Nicklas2751

Description

@Nicklas2751

The server currently includes chunk characters in the response body when the Transfer-Encoding header is set to chunked. This behavior is causing issues with parsing the response body.

When the header is set to chunked, the server should remove the chunk characters from the response body before returning it.

Steps to reproduce:

  1. Send a request to the server with the Transfer-Encoding header set to chunked.
  2. Notice that the response body includes the chunk characters.

Example:
Request

curl --request POST \
  --url http://localhost:3000/echo/body/allOf/Pet \
  --header 'Content-Type: application/json' \
  --header 'Transfer-encoding: chunked' \
  --data '{"id":42,"name":"Corgi","category":{"id":1,"name":"Dogs"},"photoUrls":["https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg"],"tags":[{"id":1,"name":"cute"}],"status":"sold"}'

Response

c0
{"id":42,"name":"Corgi","category":{"id":1,"name":"Dogs"},"photoUrls":["https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg"],"tags":[{"id":1,"name":"cute"}],"status":"sold"}
0

Expected behavior:
The server should remove the chunk characters from the response body when the Transfer-Encoding header is set to chunked.

Actual behavior:
The server includes the chunk characters in the response body when the Transfer-Encoding header is set to chunked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions