Software /
code /
prosody
Diff
net/http.lua @ 4356:10a4f3b081a7
net.http: Convert port to a number (for custom port in URL)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 22 Aug 2011 12:57:52 -0400 |
parent | 4355:9e2a841739b5 |
child | 4369:3578ff5d3674 |
line wrap: on
line diff
--- a/net/http.lua Sat Aug 20 16:51:47 2011 -0400 +++ b/net/http.lua Mon Aug 22 12:57:52 2011 -0400 @@ -134,7 +134,7 @@ 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();