Commit acf55ea
committed
fix: don't preflight-block unmetered (demo) rate-limit snapshots
Demo/unauthenticated responses carry x-api-ratelimit-limit=0,
remaining=0 with a future reset on every successful (203) call — the
API's "unmetered" signal, not an exhausted quota. The §10.3 preflight
gate read that remaining=0 as exhaustion and short-circuited every
request after the first demo response, breaking demo mode for the AAPL
options/stocks/funds data the API serves without a token.
Treat limit==0 as unmetered and allow the request; a genuine
exhaustion is limit>0 && remaining==0 (still blocked). Adds a covering
unit test (preflightAllowsWhenSnapshotIsUnmeteredDemo).1 parent 7dc5cdb commit acf55ea
2 files changed
Lines changed: 37 additions & 3 deletions
File tree
- src
- main/java/com/marketdata/sdk
- test/java/com/marketdata/sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
| |||
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
223 | | - | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
486 | 513 | | |
487 | 514 | | |
488 | 515 | | |
| |||
0 commit comments