diff options
Diffstat (limited to 'main/lua-turbo/case-sensitive-url-matching.patch')
-rw-r--r-- | main/lua-turbo/case-sensitive-url-matching.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/main/lua-turbo/case-sensitive-url-matching.patch b/main/lua-turbo/case-sensitive-url-matching.patch new file mode 100644 index 00000000000..4de2a17c9b9 --- /dev/null +++ b/main/lua-turbo/case-sensitive-url-matching.patch @@ -0,0 +1,37 @@ +From 525910f1caaa12669d51b86c9f154586ff1c1815 Mon Sep 17 00:00:00 2001 +From: John Abrahamsen <jhnabrhmsn@gmail.com> +Date: Fri, 24 Apr 2015 18:19:53 +0200 +Subject: [PATCH] Case sensitive URL matching as requested in issue #142. + +--- + turbo/web.lua | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/turbo/web.lua b/turbo/web.lua +index 80cc40a..01224da 100644 +--- a/turbo/web.lua ++++ b/turbo/web.lua +@@ -730,7 +730,13 @@ function web.RequestHandler:_execute() + end + self:prepare() + if not self._finished then +- self[self.request.method:lower()](self, unpack(self._url_args)) ++ -- If there is no URL args then do not unpack as this has a significant ++ -- cost. ++ if self._url_args and #self._url_args > 0 then ++ self[self.request.method:lower()](self, unpack(self._url_args)) ++ else ++ self[self.request.method:lower()](self) ++ end + if self._auto_finish and not self._finished then + self:finish() + end +@@ -1157,7 +1163,7 @@ end + -- class. + -- @param request (HTTPRequest instance) + function web.Application:_get_request_handlers(request) +- local path = request.path and request.path:lower() ++ local path = request.path + if not path then + path = "/" + end |