From a021aa7047368a98938946022003d0e0bd728f32 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 22 Aug 2011 12:57:52 -0400 Subject: net.http: Convert port to a number (for custom port in URL) --- net/http.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/http.lua') diff --git a/net/http.lua b/net/http.lua index 1fdde22c..a6c704e3 100644 --- a/net/http.lua +++ b/net/http.lua @@ -134,7 +134,7 @@ function request(u, ex, callback) req.method, req.headers, req.body = method, headers, body; local using_https = req.scheme == "https"; - local port = req.port or (using_https and 443 or 80); + local port = tonumber(req.port) or (using_https and 443 or 80); -- Connect the socket, and wrap it with net.server local conn = socket.tcp(); -- cgit v1.2.3