Apart from being not particularly useful (why send a header that contains no data?), it also throws off cntlm.exe (a utility for transparently authenticating anonymous traffic to an upstream proxy that requires Microsoft authentication, and which expects that header not to be present unless you want to specify a certain username). Such proxies react with 407 Proxy Authorization Required responses to empty username fields.
This way the authorization is only sent for non-empty usernames, with possibly-empty passwords, while the absence of a username will result in ommiting this header.
When creating the agent in the described way:
hpagent will use
new URL()
to parse'http://localhost:8080'
, which generates this data structure:The agent will then generate an empty
proxy-authorization
header because of this section:Apart from being not particularly useful (why send a header that contains no data?), it also throws off
cntlm.exe
(a utility for transparently authenticating anonymous traffic to an upstream proxy that requires Microsoft authentication, and which expects that header not to be present unless you want to specify a certain username). Such proxies react with407 Proxy Authorization Required
responses to empty username fields.Once I do this:
it starts to function properly. This is a work-around, but it's needlessly obscure.
Since sending an empty
proxy-authorization
header is not particularly useful, I think it would make sense to change the above check to:This way the authorization is only sent for non-empty usernames, with possibly-empty passwords, while the absence of a username will result in ommiting this header.