Changeset

7247:44b39c02eb33

plugins/mod_http: Keep query string over automatic redirects
author daurnimator <quae@daurnimator.com>
date Mon, 15 Feb 2016 16:28:22 +1100
parents 7245:210d8329dc70
children 7248:5e1fe4f0eb9c
files plugins/mod_http.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_http.lua	Sun Mar 06 18:52:22 2016 +0100
+++ b/plugins/mod_http.lua	Mon Feb 15 16:28:22 2016 +1100
@@ -47,6 +47,9 @@
 
 local function redir_handler(event)
 	event.response.headers.location = event.request.path.."/";
+ if event.request.url.query then
+ event.response.headers.location = event.response.headers.location .. "?" .. event.request.url.query
+ end
 	return 301;
 end