Skip to content

Remove white space in key value#309

Merged
janbrummer merged 1 commit intolibproxy:mainfrom
sunwxg:main
Oct 2, 2024
Merged

Remove white space in key value#309
janbrummer merged 1 commit intolibproxy:mainfrom
sunwxg:main

Conversation

@sunwxg
Copy link
Copy Markdown
Contributor

@sunwxg sunwxg commented Aug 27, 2024

Some time there are white spaces in key value like key NO_PROXY, if white space is not removed, the host name can't be ignored.

@AlynxZhou
Copy link
Copy Markdown
Contributor

I suggest also do this for config-env:

diff --git a/src/backend/plugins/config-env/config-env.c b/src/backend/plugins/config-env/config-env.c
index deb80ec..a084ffc 100644
--- a/src/backend/plugins/config-env/config-env.c
+++ b/src/backend/plugins/config-env/config-env.c
@@ -103,7 +103,11 @@ px_config_env_get_config (PxConfig     *config,
     proxy = g_getenv ("NO_PROXY");
 
   if (proxy) {
-    g_auto (GStrv) no_proxy = g_strsplit (proxy, ",", -1);
+    g_autoptr (GString) s = g_string_new (proxy);
+    g_auto (GStrv) no_proxy = NULL;
+
+    g_string_replace (s, " ", "", 0);
+    no_proxy = g_strsplit (s->str, ",", -1);
 
     if (px_manager_is_ignore (uri, no_proxy))
       return;

@janbrummer
Copy link
Copy Markdown
Contributor

@sunwxg Thanks for your PR. Could you please update your commit title so that it reflects the changed file?

@AlynxZhou Are you going to create a new PR?

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.08%. Comparing base (04c5185) to head (ff5cd06).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #309      +/-   ##
==========================================
- Coverage   69.20%   69.08%   -0.13%     
==========================================
  Files          18       18              
  Lines         880      883       +3     
  Branches      259      260       +1     
==========================================
+ Hits          609      610       +1     
- Misses        163      164       +1     
- Partials      108      109       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Some time there are white spaces in key value like key NO_PROXY, if
white space is not removed, the host name can't be ignored.
@janbrummer
Copy link
Copy Markdown
Contributor

@DimStar77 Your thoughts please

@janbrummer janbrummer merged commit cf2b232 into libproxy:main Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants