From 711168a899819105c2a61d132dda7a037aaf2301 Mon Sep 17 00:00:00 2001 From: Nathan LaFreniere Date: Tue, 8 Oct 2013 22:41:38 -0700 Subject: [PATCH] allow :port style shorthand --- httpie/input.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/httpie/input.py b/httpie/input.py index 9e159948..50f2e882 100644 --- a/httpie/input.py +++ b/httpie/input.py @@ -138,7 +138,10 @@ class Parser(ArgumentParser): if not (self.args.url.startswith((HTTP, HTTPS))): # Default to 'https://' if invoked as `https args`. scheme = HTTPS if self.env.progname == 'https' else HTTP - self.args.url = scheme + self.args.url + if self.args.url.startswith(':'): + self.args.url = scheme + 'localhost' + self.args.url + else: + self.args.url = scheme + self.args.url self._process_auth() return self.args