diff options
author | Matthew Wild <mwild1@gmail.com> | 2011-08-22 12:57:52 -0400 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2011-08-22 12:57:52 -0400 |
commit | 45ef372127bff6f9be6ebd2ae47a4f9ec6438aa5 (patch) | |
tree | 15c8cdedce51402e1ac378f6a13adff330c40286 | |
parent | e3d1510338e26d7b138c4f287cda91f5717d17d9 (diff) | |
download | prosody-45ef372127bff6f9be6ebd2ae47a4f9ec6438aa5.tar.gz prosody-45ef372127bff6f9be6ebd2ae47a4f9ec6438aa5.zip |
net.http: Convert port to a number (for custom port in URL)
-rw-r--r-- | net/http.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |