node_runtime: Improve proxy mapping (#41807)

Closes #ISSUE

More accurately map localhost to `127.0.0.1`. Previously we would
lowercase and simply replace all instances of localhost inside of the
URL string, meaning query parameters, username, password etc. could not
contain the string `localhost` or contain uppercase letters without
getting modified. Added a test ensuring the mapping logic works. The
previous implementation would fail this new test.

Release Notes:

- Improved the behavior of mapping `localhost` to `127.0.0.1` when
passing configured proxy urls to `node`
This commit is contained in:
tidely
2025-11-04 17:11:54 -05:00
committed by GitHub
parent cd04450273
commit ba7ea71c00
2 changed files with 53 additions and 8 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ use parking_lot::Mutex;
#[cfg(feature = "test-support")]
use std::fmt;
use std::{any::type_name, sync::Arc};
pub use url::Url;
pub use url::{Host, Url};
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash)]
pub enum RedirectPolicy {