Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

补充:ngx.req.get_headers与ngx.var.http_{header_name}的比较 #309

Open
Miss-you opened this issue Nov 23, 2020 · 0 comments
Open

补充:ngx.req.get_headers与ngx.var.http_{header_name}的比较 #309

Miss-you opened this issue Nov 23, 2020 · 0 comments

Comments

@Miss-you
Copy link
Contributor

ngx.req.get_headers 可以获取header信息
ngx.var.http_{header_name}也可以获取header信息,他们俩有什么异同呢?

  1. 性能上,ngx.var.http_{header_name}性能远远高于ngx.req.get_headers
  2. 获取的值上,ngx.req.get_headers可能有table值,ngx.var.http_{header_name}有多个同名header时只会获取其中一个
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant