Diff

plugins/mod_http.lua @ 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
parent 6966:3e3a83be7e14
child 7359:a5a080c12c96
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