Skip to content

Commit 4855302

Browse files
committed
fixed empty proxy details
1 parent f23f801 commit 4855302

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ee/cli/plugins/site.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,19 @@ def default(self):
363363

364364
if stype is None and self.app.pargs.proxy:
365365
stype, cache = 'proxy', ''
366-
proxyinfo = self.app.pargs.proxy[0].split(':')
367-
host = proxyinfo[0]
368-
port = '80' if len(proxyinfo) < 2 else proxyinfo[1]
366+
proxyinfo = self.app.pargs.proxy[0].strip()
367+
if not proxyinfo:
368+
Log.error(self, "Please provide proxy server host information")
369+
proxyinfo = proxyinfo.split(':')
370+
host = proxyinfo[0].strip()
371+
port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip()
369372
elif stype is None and not self.app.pargs.proxy:
370373
stype, cache = 'html', 'basic'
371374
elif stype and self.app.pargs.proxy:
372-
Log.error("proxy should not be used with other site types")
375+
Log.error(self, "proxy should not be used with other site types")
376+
if (self.app.pargs.proxy and (self.app.pargs.pagespeed
377+
or self.app.pargs.hhvm)):
378+
Log.error(self, "Proxy site can not run on pagespeed or hhvm")
373379

374380
if not self.app.pargs.site_name:
375381
try:

0 commit comments

Comments
 (0)