openresty / openresty/lua-nginx-module

ngx.header can also be run in set_by_lua block

Open
#1,485 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

As the README states(https://github.com/openresty/lua-nginx-module#ngxheaderheader), ngx.header is not supposed to be able to run in set_by_lua?
context: rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*

I test locally that do ngx.header['CUSTOM_HEADER'] = 'WHATEVER' in set_by_lua, seem I can see the headers in the HTTP response. Is that something not aligned with README?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README's ngx.header section and the documented set_by_lua execution contexts. Reproduce the reported CUSTOM_HEADER behavior in set_by_lua, then determine whether the documentation or the module behavior needs correction; done means the documented behavior and observed response agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.