Commit e5bb86c
fix: add missing proxy support to requestImages() (guacsec#447)
* fix: add missing proxy support to requestImages()
requestImages() was the only request function in analysis.js that did
not call addProxyAgent(), causing image analysis requests to bypass
the configured HTTP proxy. This wraps the fetch options with
addProxyAgent(options, opts) following the same pattern used by
requestStack, requestComponent, requestStackBatch, and validateToken.
Implements TC-3922
Assisted-by: Claude Code
* test: replace proxy integration tests with addProxyAgent unit tests
The proxy tests claimed to "verify agent is set correctly" but only
asserted on the response body — the agent was never actually checked.
Replace with direct unit tests for addProxyAgent() that verify:
- HttpsProxyAgent is created with the correct proxy URL
- Agent is set for both HTTP and HTTPS proxy URLs
- Agent is set when proxy comes from environment variable
- No agent is set when no proxy is configured
Also fix MSW v2 handler format in requestImages integration tests
(use HttpResponse.json() instead of the v1 res(ctx.json()) API).
Remove requestStack proxy integration tests that were broken due to
fake file paths — the proxy logic is now properly covered by the
addProxyAgent unit tests.
Implements TC-3922
Assisted-by: Claude Code
* fix: add missing proxy support to requestImages() and restore analysis tests
Add addProxyAgent() call to requestImages(), which was the only request
function missing proxy support. Restore and fix all analysis tests that
were excluded from CI via --grep --invert: migrate MSW v1 to v2 API,
fix stale header/option names (ex-provider-1-token → trust-da-token),
add temp file setup for requestStack/requestComponent tests, and add
addProxyAgent unit tests with actual agent verification.
Implements TC-3922
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent f2d5d72 commit e5bb86c
3 files changed
Lines changed: 149 additions & 109 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
0 commit comments