openresty / openresty/lua-nginx-module

how to parse the request header information for http 2.0?

Open
#1,851 0 comments 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 shown below,I want to parse the header information for http 2.0,It doesn't feel like it's working。

Can you help me see why?

`
server {
listen 8081 http2;

    set $target_url  '127.0.0.1:8098' ;


    location / {
        content_by_lua_block{
            ngx.log(ngx.ERR, 'access ')
            local headers = ngx.req.get_headers()
            for k, v in pairs(headers) do
                ngx.log(ngx.ERR,"headerK = "..k..' value = '..v)
                ngx.say("headerK = "..k..' value = '..v)
            end
        }
        grpc_pass   grpc://$target_url;
        
    }
}

`

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

The example uses an nginx server block with an HTTP/2 listener and calls ngx.req.get_headers() inside content_by_lua_block; start by reproducing the configuration and inspecting the ngx.log output. Done means identifying why the request headers are not available as expected and confirming the behavior with a focused reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.