fix: review findings — NaN threshold guard, percent-escape rejection in upstream model ids
- Segment: reject NaN thresholds (NaN fails every comparison, so it passed the [0,1] range check and reached the shim as the literal string "NaN"); ±Inf were already caught by the range comparisons, now covered by tests too. - upstreamPath: reject '%' in model ids — %2F/%2E%2E percent-escapes decode back into path structure server-side, bypassing the literal /?#/.. rejection. Ids never legitimately contain '%'. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WWCQcYStWXBYUy5sZWnbLT
This commit is contained in:
@@ -238,7 +238,7 @@ func TestInterpolateRejectsBadArgs(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpstreamPathRejectsSeparators(t *testing.T) {
|
||||
for _, bad := range []string{"", "a/b", "a?b", "a#b"} {
|
||||
for _, bad := range []string{"", "a/b", "a?b", "a#b", "a%2Fb", "%2e%2e", "a%b"} {
|
||||
if _, err := upstreamPath(bad, "/x"); err == nil {
|
||||
t.Errorf("upstreamPath(%q) succeeded; want error", bad)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user