Skip to content

Commit

Permalink
lua-nginx-module: bugfix cookies with nginx 1.23+
Browse files Browse the repository at this point in the history
Resolved #418
  • Loading branch information
denji authored Jan 9, 2023
1 parent b440965 commit 3a0323b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Formula/lua-nginx-module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,25 @@ def post_install
system "touch", "#{pkgshare}/src/ngx_http_lua_autoconf.h"
end
end

__END__
diff --git a/src/ngx_http_lua_headers_in.c b/src/ngx_http_lua_headers_in.c
index 7626d1f..db4d6a8 100644
--- a/src/ngx_http_lua_headers_in.c
+++ b/src/ngx_http_lua_headers_in.c
@@ -152,9 +152,15 @@ static ngx_http_lua_set_header_t ngx_http_lua_set_handlers[] = {
ngx_http_set_builtin_header },
#endif

+#if defined(nginx_version) && nginx_version >= 1023000
+ { ngx_string("Cookie"),
+ offsetof(ngx_http_headers_in_t, cookie),
+ ngx_http_set_builtin_multi_header },
+#else
{ ngx_string("Cookie"),
offsetof(ngx_http_headers_in_t, cookies),
ngx_http_set_builtin_multi_header },
+#endif

{ ngx_null_string, 0, ngx_http_set_header }
};

0 comments on commit 3a0323b

Please sign in to comment.