Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jan 2018 18:01:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 225434] [patch] Treat set but empty environment variables as unset in /usr/libexec/phttpget
Message-ID:  <bug-225434-8-QvcfgN6tcv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-225434-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-225434-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225434

--- Comment #4 from Vasil Dimov <vd@FreeBSD.org> ---
Well, to remove any confusion:

130         env_HTTP_PROXY =3D getenv("HTTP_PROXY");
131         if (env_HTTP_PROXY =3D=3D NULL)
132                 env_HTTP_PROXY =3D getenv("http_proxy");
133         if (env_HTTP_PROXY !=3D NULL) {
134                 if (strncmp(env_HTTP_PROXY, "http://", 7) =3D=3D 0)
135                         env_HTTP_PROXY +=3D 7;
136                 p =3D strchr(env_HTTP_PROXY, '/');
137                 if (p !=3D NULL)
138                         *p =3D 0;
139                 p =3D strchr(env_HTTP_PROXY, ':');
140                 if (p !=3D NULL) {
141                         *p =3D 0;
142                         proxyport =3D p + 1;
143                 } else
144                         proxyport =3D "3128";
145         }

The bug surfaces if:

1. HTTP_PROXY is set to an empty string (in this case the value of http_pro=
xy
is not looked up / is ignored)
OR
2. HTTP_PROXY is unset and http_proxy is set to an empty string

> By the way, I don't think the user agent portion of the proposed change m=
akes > sense.  An empty string user agent may be desirable, even if non-con=
formant.
Agreed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225434-8-QvcfgN6tcv>