Software /
code /
prosody
Comparison
net/http/parser.lua @ 5460:274c10668fe8
net.http.parser: Depend on util.http instead of net.http for urlencode
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 11 Apr 2013 17:37:37 +0100 |
parent | 5323:4c30f638ff55 |
child | 5461:67b674f6a299 |
comparison
equal
deleted
inserted
replaced
5459:3a821511b9ec | 5460:274c10668fe8 |
---|---|
1 | 1 |
2 local tonumber = tonumber; | 2 local tonumber = tonumber; |
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 "util.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; |