The curl transport parses raw response header lines with data.split(':') and stores only the first segment after the header name. This truncates X-Sentry-Rate-Limits values, whose documented format is retry_after:categories:scope:reason_code:namespaces:.... For example, X-Sentry-Rate-Limits: 120:error:project is passed to RateLimiter::update_from_sentry_header as only 120, so the parser ignores it and the SDK does not apply the rate limit. Because the header variable is still Some, the current else if chain also skips Retry-After and bare 429 fallback handling. See curl.rs, ratelimit.rs, and the Sentry SDK rate limiting docs.
We should fix the curl header parsing to preserve the complete value after the first colon, for example with split_once(':') or splitn(2, ':'). We should also add a regression test that exercises a raw curl-style header line such as X-Sentry-Rate-Limits: 120:error:project and verifies that the complete value reaches the rate limiter. A small helper for parsing header lines would make this straightforward to unit test without requiring a curl-backed integration server.
The curl transport parses raw response header lines with
data.split(':')and stores only the first segment after the header name. This truncatesX-Sentry-Rate-Limitsvalues, whose documented format isretry_after:categories:scope:reason_code:namespaces:.... For example,X-Sentry-Rate-Limits: 120:error:projectis passed toRateLimiter::update_from_sentry_headeras only120, so the parser ignores it and the SDK does not apply the rate limit. Because the header variable is stillSome, the currentelse ifchain also skipsRetry-Afterand bare429fallback handling. Seecurl.rs,ratelimit.rs, and the Sentry SDK rate limiting docs.We should fix the curl header parsing to preserve the complete value after the first colon, for example with
split_once(':')orsplitn(2, ':'). We should also add a regression test that exercises a raw curl-style header line such asX-Sentry-Rate-Limits: 120:error:projectand verifies that the complete value reaches the rate limiter. A small helper for parsing header lines would make this straightforward to unit test without requiring a curl-backed integration server.