From 1c6280f578599595048a0093ea7ca1ffb4fe7fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?agentzh=20=28=E7=AB=A0=E4=BA=A6=E6=98=A5=29?= Date: Thu, 14 Jun 2012 19:29:12 +0800 Subject: [PATCH] docs: documented the lua_transform_underscores_in_response_headers directive. --- README | 20 ++++++++++++++++++-- README.markdown | 19 ++++++++++++++++++- doc/HttpLuaModule.wiki | 18 +++++++++++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/README b/README index 13494143..b0d651f0 100644 --- a/README +++ b/README @@ -1023,6 +1023,18 @@ Directives This directive was first introduced in the "v0.5.0rc29" release. + lua_transform_underscores_in_response_headers + syntax: *lua_transform_underscores_in_response_headers on|off* + + default: *lua_transform_underscores_in_response_headers on* + + context: *http, server, location, location-if* + + Controls whether to transform underscores ("_") in the response header + names specified in the ngx.header.HEADER API to hypens ("-"). + + This directive was first introduced in the "v0.5.0rc32" release. + Nginx API for Lua Introduction The various *_by_lua and *_by_lua_file configuration directives serve as @@ -1679,8 +1691,12 @@ Nginx API for Lua header_filter_by_lua*, log_by_lua** Set, add to, or clear the current request "HEADER" response header. - Underscores ("_") in the header names will be replaced by dashes ("-") - and the header names will be matched case-insensitively. + + Underscores ("_") in the header names will be replaced by hyphens ("-") + by default. This transformation can be turned off via the + lua_transform_underscores_in_response_headers directive. + + The header names are matched case-insensitively. -- equivalent to ngx.header["Content-Type"] = 'text/plain' ngx.header.content_type = 'text/plain'; diff --git a/README.markdown b/README.markdown index 5c839adf..cb7826aa 100644 --- a/README.markdown +++ b/README.markdown @@ -930,6 +930,19 @@ Controls whether or not to disable postponing [rewrite_by_lua](http://wiki.nginx This directive was first introduced in the `v0.5.0rc29` release. +lua_transform_underscores_in_response_headers +--------------------------------------------- + +**syntax:** *lua_transform_underscores_in_response_headers on|off* + +**default:** *lua_transform_underscores_in_response_headers on* + +**context:** *http, server, location, location-if* + +Controls whether to transform underscores (`_`) in the response header names specified in the [ngx.header.HEADER](http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER) API to hypens (`-`). + +This directive was first introduced in the `v0.5.0rc32` release. + Nginx API for Lua ================= Introduction @@ -1575,7 +1588,11 @@ ngx.header.HEADER **context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, log_by_lua** -Set, add to, or clear the current request `HEADER` response header. Underscores (`_`) in the header names will be replaced by dashes (`-`) and the header names will be matched case-insensitively. +Set, add to, or clear the current request `HEADER` response header. + +Underscores (`_`) in the header names will be replaced by hyphens (`-`) by default. This transformation can be turned off via the [lua_transform_underscores_in_response_headers](http://wiki.nginx.org/HttpLuaModule#lua_transform_underscores_in_response_headers) directive. + +The header names are matched case-insensitively. -- equivalent to ngx.header["Content-Type"] = 'text/plain' diff --git a/doc/HttpLuaModule.wiki b/doc/HttpLuaModule.wiki index cb3354be..0e18c73d 100644 --- a/doc/HttpLuaModule.wiki +++ b/doc/HttpLuaModule.wiki @@ -892,6 +892,18 @@ Controls whether or not to disable postponing [[#rewrite_by_lua|rewrite_by_lua]] This directive was first introduced in the v0.5.0rc29 release. +== lua_transform_underscores_in_response_headers == + +'''syntax:''' ''lua_transform_underscores_in_response_headers on|off'' + +'''default:''' ''lua_transform_underscores_in_response_headers on'' + +'''context:''' ''http, server, location, location-if'' + +Controls whether to transform underscores (_) in the response header names specified in the [[#ngx.header.HEADER|ngx.header.HEADER]] API to hypens (-). + +This directive was first introduced in the v0.5.0rc32 release. + = Nginx API for Lua = == Introduction == The various *_by_lua and *_by_lua_file configuration directives serve as gateways to the Lua API within the nginx.conf file. The Nginx Lua API described below can only be called within the user Lua code run in the context of these configuration directives. @@ -1523,7 +1535,11 @@ before sending out the response headers. '''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, log_by_lua*'' -Set, add to, or clear the current request HEADER response header. Underscores (_) in the header names will be replaced by dashes (-) and the header names will be matched case-insensitively. +Set, add to, or clear the current request HEADER response header. + +Underscores (_) in the header names will be replaced by hyphens (-) by default. This transformation can be turned off via the [[#lua_transform_underscores_in_response_headers|lua_transform_underscores_in_response_headers]] directive. + +The header names are matched case-insensitively. -- equivalent to ngx.header["Content-Type"] = 'text/plain'