Skip to content

Commit 7d5d923

Browse files
committed
docs: fixed the documenation for ngx.req.set_header and made it explicit that the modified request headers will be inherited by the subrequests. thanks James Hurst for reporting this nit.
1 parent d0d9140 commit 7d5d923

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,8 +2415,11 @@ Nginx API for Lua
24152415
header_filter_by_lua*, body_filter_by_lua*
24162416

24172417
Set the current request's request header named "header_name" to value
2418-
"header_value", overriding any existing ones. None of the current
2419-
request's subrequests will be affected.
2418+
"header_value", overriding any existing ones.
2419+
2420+
By default, all the subrequests subsequently initiated by
2421+
ngx.location.capture and ngx.location.capture_multi will automatically
2422+
inherit the new header.
24202423

24212424
Here is an example of setting the "Content-Length" header:
24222425

README.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,8 @@ ngx.req.set_header
22742274
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*
22752275

22762276
Set the current request's request header named `header_name` to value `header_value`, overriding any existing ones.
2277-
None of the current request's subrequests will be affected.
2277+
2278+
By default, all the subrequests subsequently initiated by [ngx.location.capture](http://wiki.nginx.org/HttpLuaModule#ngx.location.capture) and [ngx.location.capture_multi](http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi) will automatically inherit the new header.
22782279

22792280
Here is an example of setting the `Content-Length` header:
22802281

doc/HttpLuaModule.wiki

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,8 @@ Removing the <code>max_headers</code> cap is strongly discouraged.
22082208
'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua''
22092209
22102210
Set the current request's request header named <code>header_name</code> to value <code>header_value</code>, overriding any existing ones.
2211-
None of the current request's subrequests will be affected.
2211+
2212+
By default, all the subrequests subsequently initiated by [[#ngx.location.capture|ngx.location.capture]] and [[#ngx.location.capture_multi|ngx.location.capture_multi]] will automatically inherit the new header.
22122213
22132214
Here is an example of setting the <code>Content-Length</code> header:
22142215

0 commit comments

Comments
 (0)