mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-07-18 09:52:56 -05:00
[PR #7243] http_client: don't panic on invalid block regex; use RwLock #24776
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/7243
Author: @nghiphaam
Created: 5/20/2026
Status: 🔄 Open
Base:
main← Head:fix/http-block-regex-no-panic📝 Commits (1)
a9893d6http_client: don't panic on invalid block regex; use RwLock📊 Changes
1 file changed (+19 additions, -11 deletions)
View changed files
📝
src/http_client.rs(+19 -11)📄 Description
should_block_address_regexcalledRegex::new(&block_regex).unwrap()on every miss. Config validation (config.rs) already rejects invalid patterns, but a slip-through (e.g. test path or a race) would crash the server mid-request. Swap theunwrap()for a logged warning + skip-block fallback.Also switched the cache from
MutextoRwLockso concurrent outbound HTTP checks don't serialise on the same lock when the regex is unchanged.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.