Skip to content

x-request-id header missing in empty body responses #112

@diego-sepulveda-lavin

Description

@diego-sepulveda-lavin

Package version

@adonisjs/http-server@7.7.0

Describe the bug

When using generateRequestId:true in config/app.ts, the expected behaviour is that the Request has the id property (this is working fine) see request docs. In the Response we should have the x-response-id header which is working fine except for responses without body, like noContent, created, etc, where the header is missing. Documentation does not mention exceptions for these cases see response docs.

Here I have two endpoints, one with empty body and the other with body 👇
Image

Empty body endpoint has no x-response-id header 👇
Image

With body endpoint has a x-response-id header 👇
Image

Reproduction repo

No response

Metadata

Metadata

Assignees

No one assigned

    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