Move and edit a comment about HTTP status code 416 to reduce

confusion.
main
Michael Chisholm 2021-08-24 15:04:05 -04:00
parent a3d1056122
commit a4ce0222bf
1 changed files with 6 additions and 4 deletions

View File

@ -308,11 +308,13 @@ class TAXIICollectionSource(DataSource):
" the supplied TAXII Collection object are either not found or access is"
" denied. Received error: ", e,
)
# TAXII 2.0 paging can result in a 416 (Range Not Satisfiable) if
# the server isn't sending Content-Range headers, so the pager just
# goes until it runs out of pages. So 416 can't be treated as a
# real error, just an end-of-pages condition. For other codes,
# propagate the exception.
elif e.response.status_code != 416:
# TAXII 2.0 paging can result in a 416 (Range Not Satisfiable)
# if the server isn't sending Content-Range headers, so the
# pager just goes until it runs out of pages. So 416 can't be
# treated as a real error, just an end-of-pages condition.
raise
# deduplicate data (before filtering as reduces wasted filtering)