openresty / openresty/lua-nginx-module
Set/Remove response headers without underscore to hyphen normalization
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.8k
- Forks
- 2.1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 6
Description
Hi @agentzh,
I would like to add support to set response headers without applying underscore to hyphen normalization. I know we can enable this globally by setting lua_transform_underscores_in_response_headers, but I need a way to do this on specific cases, while maintaining the normalization enabled globally.
I can implement this an open a PR, but I think it is a good idea to first discuss how this would look like. My idea is to create a function ngx.resp.set_header_raw(header_name, header_value) (header_value can be a string or a table, just like with ngx.header.HEADER).
Does that sound reasonable?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the response-header handling behind ngx.header.HEADER and the lua_transform_underscores_in_response_headers setting. Evaluate the proposed ngx.resp.set_header_raw(header_name, header_value) API, including string and table values, and define completion as allowing selected response headers to bypass underscore-to-hyphen normalization while the global behavior remains enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100