Skip to content

Commit e54a9e5

Browse files
committed
improve: supported the link response header
Since Nginx/1.13.10. The `Link` header was treated as a common header and equipped a shortcut pointer (`r->headers_out.link`). Currently this module doesn't follow this behavior. Consequently, `Link` header set by this module (e.g. in `header_filter_by_lua*`) cannot be referenced from `r->headers_out.link`. It may cause some inconsistent problems. For instance, the HTTP/2 server push preload, see openresty#1458 for details. This Commit placed the Link header inside `ngx_http_lua_set_handlers[]`.
1 parent 7c2b58e commit e54a9e5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ngx_http_lua_headers_out.c

+8
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ static ngx_http_lua_set_header_t ngx_http_lua_set_handlers[] = {
106106
offsetof(ngx_http_headers_out_t, cache_control),
107107
ngx_http_set_builtin_multi_header },
108108

109+
#if nginx_version >= 1013010
110+
111+
{ ngx_string("Link"),
112+
offsetof(ngx_http_headers_out_t, link),
113+
ngx_http_set_builtin_multi_header },
114+
115+
#endif
116+
109117
{ ngx_null_string, 0, ngx_http_set_header }
110118
};
111119

0 commit comments

Comments
 (0)