summaryrefslogtreecommitdiff
path: root/lib/http
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-06-20 22:20:23 -0700
committerOri Bernstein <ori@eigenstate.org>2016-06-29 21:02:12 -0700
commit1d4f6a7925c05705dda39c9fe799c64138d6d02a (patch)
treec6ea746619156ed18fd62007ebf3c236bdca58d6 /lib/http
parenta66d6276ae7dbea35f70632ac0bde623c2d2ee93 (diff)
downloadmc-1d4f6a7925c05705dda39c9fe799c64138d6d02a.tar.gz
Add 'http://' if it's not already there.
Diffstat (limited to 'lib/http')
-rw-r--r--lib/http/main.myr3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/http/main.myr b/lib/http/main.myr
index fa99a62..c317f85 100644
--- a/lib/http/main.myr
+++ b/lib/http/main.myr
@@ -35,6 +35,9 @@ const main = {args
;;
for url in cmd.args
+ if !std.hasprefix(url, "http")
+ url = std.fmt("http://{}", url)
+ ;;
u = std.try(http.parseurl(url))
s = std.try(http.mksession(u.schema, u.host, u.port))