Skip to content

Commit

Permalink
Expand positive responses for dead link checking
Browse files Browse the repository at this point in the history
  • Loading branch information
le717 committed Aug 27, 2021
1 parent 1585d58 commit 9f67926
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.0.5

_Unreleased_

- Expand positive responses for dead link checking

# 1.0.4

_Released August 19, 2021_
Expand Down
7 changes: 6 additions & 1 deletion src/core/database/linkrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ def __ping_url(url: str) -> bool:
"""Check a link for rotting."""
try:
r = requests.head(url)
return r.status_code == requests.codes.ok
return r.status_code in (
requests.codes.ok,
requests.codes.created,
requests.codes.no_content,
requests.codes.not_modified
)
except Exception:
return False

Expand Down

0 comments on commit 9f67926

Please sign in to comment.