From: Matthew Wild Date: Thu, 29 Nov 2012 02:38:00 +0000 (+0500) Subject: net.http.parser: Collapse multiple consecutive slashes in a path to a single slash X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=422fc2df98023adc7495be5a8dc3709cb933530c;p=prosody.git net.http.parser: Collapse multiple consecutive slashes in a path to a single slash --- diff --git a/net/http/parser.lua b/net/http/parser.lua index 964c350d..606d750c 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -5,7 +5,7 @@ local url_parse = require "socket.url".parse; local urldecode = require "net.http".urldecode; local function preprocess_path(path) - path = urldecode(path); + path = urldecode((path:gsub("//+". "/"))); if path:sub(1,1) ~= "/" then path = "/"..path; end