diff --git a/CHANGES.rst b/CHANGES.rst index 952178e39..8f985ff45 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ CHANGES ======= +1.1.1 (2018-02-17) +------------------ + +* Fix performance regression: don't encode enmpty netloc (#170) + 1.1.0 (2018-01-21) ------------------ diff --git a/yarl/__init__.py b/yarl/__init__.py index 4227f44eb..f8a685735 100644 --- a/yarl/__init__.py +++ b/yarl/__init__.py @@ -196,8 +196,11 @@ def build(cls, *, scheme='', user='', password='', host='', port=None, raise ValueError( "Only one of \"query\" or \"query_string\" should be passed") - netloc = cls._make_netloc(user, password, host, port, - encode=not encoded) + if not user and not password and not host and not port: + netloc = '' + else: + netloc = cls._make_netloc(user, password, host, port, + encode=not encoded) if not encoded: path = cls._PATH_QUOTER(path) if netloc: