Skip to content

fix(rate_limit): replace HeaderValue unwrap with infallible int_heade…#684

Open
Olisachukwuma1 wants to merge 2 commits into
kellymusk:masterfrom
Olisachukwuma1:fix/panic-prone-calls
Open

fix(rate_limit): replace HeaderValue unwrap with infallible int_heade…#684
Olisachukwuma1 wants to merge 2 commits into
kellymusk:masterfrom
Olisachukwuma1:fix/panic-prone-calls

Conversation

@Olisachukwuma1

Copy link
Copy Markdown
Contributor

closes #633
closes #634
closes #635
closes #636

…r helper

All 5 unwrap() calls on HeaderValue::from_str were converting i64::to_string() values, which only produce ASCII digits and are always valid header values. Extracted int_header() helper that documents the invariant and uses unwrap_or_else as a safe fallback instead of bare unwrap.

Closes issues: rate_limit.rs panic-prone calls audit

…r helper

All 5 unwrap() calls on HeaderValue::from_str were converting i64::to_string()
values, which only produce ASCII digits and are always valid header values.
Extracted int_header() helper that documents the invariant and uses
unwrap_or_else as a safe fallback instead of bare unwrap.

Closes issues: rate_limit.rs panic-prone calls audit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant