# HG changeset patch # User jbe # Date 1498570704 -7200 # Node ID 7a7770297ae862dc1fa795a2f9d5edd06d17d931 # Parent b29e082cafb872125684bd162db5a66c41dd4a04 Fixed error in error handling when catching illegal static path diff -r b29e082cafb8 -r 7a7770297ae8 framework/env/request/handler.lua --- a/framework/env/request/handler.lua Sun Jun 18 03:03:48 2017 +0200 +++ b/framework/env/request/handler.lua Tue Jun 27 15:38:24 2017 +0200 @@ -67,14 +67,15 @@ if request._route.static then local subpath = request._route.static + local errmsg for element in string.gmatch(subpath, "[^/]+") do if element == "." or element == ".." then - subpath = nil + errmsg = "Illegal path" break end end - local fstat, f, errmsg - if subpath then + local fstat, f + if not errmsg then local filename = WEBMCP_BASE_PATH .. "static/" .. subpath fstat, errmsg = extos.stat(filename) if fstat then