Comparison

net/http/parser.lua @ 5224:ba51d0917c64

Merge 0.9->trunk.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 03 Dec 2012 10:04:34 +0500
parent 5222:61c47d26481d
child 5259:c85c348253bd
comparison
equal deleted inserted replaced
5221:115cf8252be8 5224:ba51d0917c64
3 local assert = assert; 3 local assert = assert;
4 local url_parse = require "socket.url".parse; 4 local url_parse = require "socket.url".parse;
5 local urldecode = require "net.http".urldecode; 5 local urldecode = require "net.http".urldecode;
6 6
7 local function preprocess_path(path) 7 local function preprocess_path(path)
8 path = urldecode((path:gsub("//+". "/"))); 8 path = urldecode((path:gsub("//+", "/")));
9 if path:sub(1,1) ~= "/" then 9 if path:sub(1,1) ~= "/" then
10 path = "/"..path; 10 path = "/"..path;
11 end 11 end
12 local level = 0; 12 local level = 0;
13 for component in path:gmatch("([^/]+)/") do 13 for component in path:gmatch("([^/]+)/") do