hoverfly icon indicating copy to clipboard operation
hoverfly copied to clipboard

Unable to parse an upstream URL that contains a Win Domain\user

Open AndyGee opened this issue 6 years ago • 1 comments

Given the following upstream URL:

http://WINDOMAIN\MYUSER:[email protected]:8080

HoverFly fails with this response:

Could not parse upstream proxy: %!(EXTRA string=parse http://WINDOMAIN\MYUSER:[email protected]:8080: net/url: invalid userinfo)

Escaping the backslash has the same issue.

An alternative syntax using an @ symbol also fails, due to the first @ being interpreted as the prefix marker, not the last:

http://MYUSER@WINDOMAIN:[email protected]:8080

Curl accepts both URL forms.

AndyGee avatar Dec 18 '18 20:12 AndyGee

Just tried testing this for myself and got different but still unexpected results.

When testing it on Linux with

hoverctl start --upstream-proxy http://WINDOMAIN\MYUSER:[email protected]:8080

Hoverfly starts, but is configured with the incorrectly with the backslash ignored

"upstreamProxy":"http://WINDOMAINMYUSER:[email protected]:8080"

Also just tried

hoverctl start --upstream-proxy http://WINDOMAIN/\MYUSER:[email protected]:8080

Which I think worked? I'm unable to test the upstream working but Hoverfly does start with the upstreamProxy correctly configured.

"upstreamProxy":"http://WINDOMAIN/MYUSER:[email protected]:8080"

@AndyGee What OS are you using? Are you using hoverctl to start Hoverfly?

benjih avatar Jan 22 '19 22:01 benjih