Skip to content

Commit

Permalink
[web]: Simplify HTTP properties by removing useless hasattr/getattr c…
Browse files Browse the repository at this point in the history
…hecks (#211)
  • Loading branch information
prologic committed Jan 23, 2017
1 parent 70080ac commit 25442fc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions circuits/web/http.py
Expand Up @@ -65,20 +65,16 @@ def protocol(self):

@property
def scheme(self):
if not hasattr(self, "_server"):
return
return "https" if self._server.secure else "http"

@property
def base(self):
if getattr(self, "uri", None) is None:
return
if self.uri is None:
return ""
return self.uri.utf8().rstrip(b"/").decode(self._encoding)

@property
def uri(self):
if getattr(self, "_uri", None) is None:
return
return self._uri

@handler("ready", priority=1.0)
Expand Down

0 comments on commit 25442fc

Please sign in to comment.