In previous versions of https, a HEAD request's iter_bytes would return a simple empty byte string. Now, it looks like no byte string it returned, and so next would raise a StopIteration. We use the 2nd argument to next to ignore the StopIteration if it happens.
(The next is there it exhaust the iterable to make sure httpx knows it can re-use the connection to S3)
In previous versions of https, a HEAD request's iter_bytes would return a simple empty byte string. Now, it looks like no byte string it returned, and so
next
would raise a StopIteration. We use the 2nd argument tonext
to ignore the StopIteration if it happens.(The
next
is there it exhaust the iterable to make sure httpx knows it can re-use the connection to S3)