Skip to content

Set headers in body_filter_by_lua* #825

@adrianke

Description

@adrianke

When trying to set headers via ngx.headers.HEADER in body_filter_by_lua*, I get the following error:

*311 attempt to set ngx.header.HEADER after sending out response headers while sending to client

I need to set headers based on what's in the response. Is there a way to delay the first byte of the response until I've set my headers? Kind of like lua_need_request_body.

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