# HG changeset patch # User jbe # Date 1469121582 -7200 # Node ID 4e03ecb28665b0b76bcdf206c34a9f29e51f68c2 # Parent 1b380a0ab940f763d0a648f7f6e7457f5dacf5c6 Do not include _tempstore by default for external URLs diff -r 1b380a0ab940 -r 4e03ecb28665 framework/env/request/handler.lua --- a/framework/env/request/handler.lua Thu Jul 21 19:13:02 2016 +0200 +++ b/framework/env/request/handler.lua Thu Jul 21 19:19:42 2016 +0200 @@ -235,10 +235,12 @@ end) elseif redirect_data then redirect_data = table.new(redirect_data) - redirect_data.params = table.new(redirect_data.params) - local slot_dump = slot.dump_all() - if slot_dump ~= "" then - redirect_data.params._tempstore = tempstore.save(slot_dump) + if not redirect_data.external or redirect_data.include_tempstore then + redirect_data.params = table.new(redirect_data.params) + local slot_dump = slot.dump_all() + if slot_dump ~= "" then + redirect_data.params._tempstore = tempstore.save(slot_dump) + end end http_request:send_status("303 See Other") for i, header in ipairs(request._response_headers) do diff -r 1b380a0ab940 -r 4e03ecb28665 framework/env/request/redirect.lua --- a/framework/env/request/redirect.lua Thu Jul 21 19:13:02 2016 +0200 +++ b/framework/env/request/redirect.lua Thu Jul 21 19:19:42 2016 +0200 @@ -1,14 +1,15 @@ --[[-- request.redirect{ - external = external, -- external URL (instead of specifying base, module, etc. below) - base = base, -- optional string containing a base URL of a WebMCP application - static = static, -- an URL relative to the static file directory - module = module, -- a module name of the WebMCP application - view = view, -- a view name of the WebMCP application - action = action, -- an action name of the WebMCP application - id = id, -- optional id to be passed to the view or action to select a particular data record - params = params, -- optional parameters to be passed to the view or action - anchor = anchor -- anchor in URL + external = external, -- external URL (instead of specifying base, module, etc. below) + base = base, -- optional string containing a base URL of a WebMCP application + static = static, -- an URL relative to the static file directory + module = module, -- a module name of the WebMCP application + view = view, -- a view name of the WebMCP application + action = action, -- an action name of the WebMCP application + id = id, -- optional id to be passed to the view or action to select a particular data record + params = params, -- optional parameters to be passed to the view or action + anchor = anchor, -- anchor in URL + include_tempstore = include_tempstore -- set to true to include slot data via _tempstore param when using external URL } Calling this function causes the WebMCP to do a 303 HTTP redirect after the current view or action and all filters have finished execution. If routing mode "redirect" has been chosen, then this function is called automatically after an action and all its filters have finished execution. Calling request.redirect{...} (or request.forward{...}) explicitly inside an action will cause routing information from the browser to be ignored. To preserve GET/POST parameters of an action, use request.forward{...} instead. Currently no redirects to external (absolute) URLs are possible, there will be an implementation in future though.