Closed jclusso closed 7 months ago
Hi @jclusso, sorry about the confusion here, it took me a while to figure this out as well! It turns out, you're doing nothing wrong. What you're doing is reasonable and I'd expect it to work as well.
However, the adapter you're using net_http_persistent
has a little caching of its own for the proxy.
You can see how they decide if using the cached proxy or not based on the uri in this line.
I'm gonna close this issue simply because this is not an issue with Faraday itself, but rather with the adapter implementation.
As that adapter is not actively maintained by anyone, I'd strongly encourage you to open up a PR if you'd like to see this fixed in the adapter. I don't use net_http_persistent
much myself, so I'm unsure how much of an impact removing the cache would have, but I'd be happy to review a PR backed by some tests 👍
Otherwise, it seems like your idea of repeating the uri
works. If you end up changing adapter you can try again removing it.
Turns out this is fixed in Faraday 2 and the latest versions of net_http_persistent.
Basic Info
Issue description
If you try and change the proxy user of a connection, it does not change unless the URI has changed. I'm not sure if this is the intended behaviour or if there is a way around this. The only thing I've found I can do is to add some sort of query parameter on the proxy
uri
which will fix it. I assume it has something to do with how this works, but I couldn't figure it out.Steps to reproduce
The code below will not change the proxy user on the retry. If you change the
uri
it will work and theuser
will be updated.