You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address Copilot review on bounded reads and redirect-safety
- read_response_limited: read in a loop until EOF or one byte past the
limit instead of a single read(max_bytes + 1). A server using chunked
transfer encoding can return fewer bytes per read() than requested
while streaming more than max_bytes total, defeating the single-read
bound. Add regression tests for the short-read and within-limit paths.
- _download_security: annotate _raise / _raise_from as NoReturn so type
checkers treat call sites as unreachable.
- Extract the duplicated is_https_or_localhost_http redirect-safety
predicate into _download_security and import it from both _github_http
and authentication/http so the rule lives in one place.
- azure_devops: stop catching broad ValueError/KeyError around token
acquisition; give the bounded read a dedicated _TokenResponseTooLarge
type and catch only URLError, OSError, JSONDecodeError, and that type
so unrelated programming errors still surface.
- tests: make response mocks faithful streams (advancing cursor, b"" at
EOF) so the bounded read loop terminates as it would against a real
http.client.HTTPResponse.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments