Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Commit

Permalink
Handle urls containing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
daggelpop committed Jun 23, 2021
1 parent 1eed2c3 commit 1b6bfc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion email2pdf
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ def remove_invalid_urls(payload):

def can_url_fetch(src):
try:
req = Request(src)
encoded_src = src.replace(" ", "%20")
req = Request(encoded_src)
urlopen(req)
except HTTPError:
return False
Expand Down

0 comments on commit 1b6bfc3

Please sign in to comment.