fix(sandbox): support conditional request injections#452
Conversation
Add conditional request injection fields to the sandbox SDK types and camelCase normalization path. Also align Qiniu-auth GET signing with the default content type used by the HTTP client, and cover the behavior with tests and examples.
There was a problem hiding this comment.
Code Review
This pull request adds support for baseUrl path prefix matching, as well as ifHeaders and ifQueries condition matching for sandbox request injections. It updates the TypeScript type definitions, client normalization logic, examples, and test coverage. It also ensures that the Content-Type header is removed for GET and HEAD requests without a body to allow correct default signing. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #452 +/- ##
==========================================
+ Coverage 93.41% 93.44% +0.02%
==========================================
Files 14 14
Lines 2006 2014 +8
==========================================
+ Hits 1874 1882 +8
Misses 132 132
🚀 New features to boost your workflow:
|
Summary
baseUrl,ifHeaders, andifQueriesValidation
npm run test:sandboxnpm run check-typenpx eslint qiniu/sandbox/client.js test/sandbox_client.test.js examples/sandbox_injection_rules.js examples/sandbox_request_injections.jsNODE_ENV=test npx mocha -t 600000 --retries 0 test/sandbox_integration.test.jsnode examples/sandbox_request_injections.jsnode examples/sandbox_injection_rules.js