Skip to content

Commit

Permalink
Strip whitespace from Project-URL values (#2813)
Browse files Browse the repository at this point in the history
  • Loading branch information
di authored Jan 18, 2018
1 parent 91d7820 commit a0e091c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/unit/packaging/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ def test_has_meta_false(self, db_session):
("Source Code", "https://example.com/source-code/"),
]),
),
(
None,
None,
["Source Code, https://example.com/source-code/"],
OrderedDict([
("Source Code", "https://example.com/source-code/"),
]),
),
(
"https://example.com/home/",
"https://example.com/download/",
Expand Down
2 changes: 1 addition & 1 deletion warehouse/packaging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def urls(self):
_urls["Homepage"] = self.home_page

for urlspec in self.project_urls:
name, url = urlspec.split(",", 1)
name, url = [x.strip() for x in urlspec.split(",", 1)]
_urls[name] = url

if self.download_url and "Download" not in _urls:
Expand Down

0 comments on commit a0e091c

Please sign in to comment.