summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-09-06 14:40:07 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-09-06 14:40:07 +0100
commit05d8f110fdc5eca353307e977e9d78c72ee2d522 (patch)
tree5206602fface3875d2dc10ef54257eda79534c6d
parent9b8833619780eb1c8c2fffc0f95cf93c6adb1d83 (diff)
downloadgitano-05d8f110fdc5eca353307e977e9d78c72ee2d522.tar.gz
ACTIONS: Support hostname:port in the host argument to the HTTP methods
-rw-r--r--lib/gitano/actions.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitano/actions.lua b/lib/gitano/actions.lua
index b6defc5..1da7cbb 100644
--- a/lib/gitano/actions.lua
+++ b/lib/gitano/actions.lua
@@ -44,7 +44,11 @@ end
local function http_txn(method, host, path, headers, body)
log.ddebug("Attempting to fetch",host,":", path)
log.ddebug("Connect...")
- sock = assert(sio.connect(host, "http"))
+ local port = "http"
+ if host:match(":") then
+ host, port = host:match("^(.-):([^:]+)$")
+ end
+ sock = assert(sio.connect(host, port))
local req_lines = {
method .. " " .. path .. " HTTP/1.0",
"Host: " .. host,