Repository navigation
v3.3.0 — the cap was checked after the body was already in memory
RT #1601, the fleet's outbound HTTP contract. Three read paths here — the API, a content download and the OAuth token exchange — and all three had the same defect.
- The cap was checked after the body was in memory. Each path compared
len(response.content) > MAX_RESPONSE_SIZEonce the whole body had arrived. All three now stream, measured before each chunk is copied in, becauseaiter_bytes()promises nothing about chunk size: one chunk can be the whole body. The token exchange gets its own, smaller cap — a token response is a handful of JSON fields, and anything page-sized answering on that URL is not a token. - Requests were nameless. All three paths now send
mcp-pcloud-crunchtools/<version> (+<repo>), the version read from installed package metadata so it cannot drift frompyproject.toml. Malformed JSON from listfolderblamed the parser for what is usually a challenge page. Errors now name the method, the full requested URL, the status, the content-type and a bounded snippet.
A pCloud content URL is signed, so naming it is only safe because the signature comes out first: userinfo is dropped and credential-shaped query parameters are replaced. The token exchange quotes no body at all — it is the one endpoint whose body is a credential.
Two things review caught that are worth recording:
- Replacing
response.textlost the declared charset, so a Latin-1 document would have come back with replacement characters where its accents were. It decodes withresponse.encodingnow. - The old suite patched
httpx.AsyncClient.getandhttpx.Client.post. A patch on a method the code no longer calls does not fail — it lets the test reach the real network, which is how three tests were briefly talking to api.pcloud.com. The suite rides aMockTransportnow, which has no live socket to fall through to.
Constitution pin v1.31.0 → v1.36.0.