Skip to content

POST doesn't close the connection when 204 response used #80

@billmote

Description

@billmote

What you did:

Created a POST route
{ "id": "8e54c04a-21fd-4cb3-b8de-1aa5a9ef988e", "route": "/events", "httpMethod": "POST", "statusCode": "204", "delay": "0", "payload": { "success": true }, "headers": [ { "id": "6ffb195d-c434-46da-a08c-52090415c949", "header": "Retry-After", "value": "60" } ], "disabled": false }
that responds with a HTTP 204 with a simple body of { success: true } and posted:

curl --request POST '169.254.241.176:3000/events' --header 'Content-Type: application/json' --data-raw '[{"eventId":"fbf1de19-8629-45d3-ad0f-34b8e17d594f","sessionId":"07726e3d-68ed-49a2-bb37-d1372e941191","dateTime":"2020-08-14T01:45:44.975Z","eventType":"App Launched","category":"engagement","latitude":40.4543,"longitude":41.4563},{"eventId":"37314774-d52b-4219-b5c4-e3b2c14aeda0","sessionId":"48830e55-33b2-4a8e-b5c7-710b85b44bf5","dateTime":"2020-08-14T01:56:53.220Z","eventType":"view cart","category":"engagement","latitude":40.4543,"longitude":41.4563,"sku":"abc123","price":10.95},{"eventId":"6c8a2370-0fb0-4c47-8914-11a8e2ffe47f","sessionId":"48830e55-33b2-4a8e-b5c7-710b85b44bf5","dateTime":"2020-08-14T01:57:23.341Z","eventType":"App Launched","category","engagement","latitude":40.4543,"longitude":41.4563}]'

What happened:

The body isn't delivered for ~90 seconds -- my connection timeout on the client is set to 30 seconds.

Problem description:

Because it should immediately respond and close the connection?

Suggested solution:

Changing nothing other than the response code back to HTTP 200 fixes the problem (the route responds instantaneously), but I would like to emulate several of the available responses, and I specifically need the 204 response for this POST :)

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