Skip to content

Commit

Permalink
fix: url netloc already covers port number
Browse files Browse the repository at this point in the history
  • Loading branch information
simojo committed Oct 27, 2023
1 parent e7ed5e7 commit a6ca8fb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions chasten/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def is_url(url: str) -> bool:
# parse input url
url_parsed = URL(url)
# only input characters for initiatig query and/or fragments if necessary
port_character = ":" if (url_parsed.port() is not None) else ""
query_character = "?" if url_parsed.query() else ""
fragment_character = "#" if url_parsed.fragment() else ""
# piece the url back together to make sure it matches what was input
Expand All @@ -71,9 +70,6 @@ def is_url(url: str) -> bool:
url_parsed.scheme(),
"://",
url_parsed.netloc(),
port_character,
# to handle if port() is `None` type
str(url_parsed.port() if (url_parsed.port() is not None) else ""),
url_parsed.path(),
query_character,
url_parsed.query(),
Expand Down

0 comments on commit a6ca8fb

Please sign in to comment.