fix(sessionresolver): proxy check conditional on existing proxy (#264)

There was a face-palming error in the implementation causing the proxy
check to be implemented also without a proxy.

This meant that we were ALWAYS skipping http3 and system resolvers.

The bug has been introduced in 3.8.0. So, the currently released
version of the probe, sadly, has this beheavior :-(.

Reference issue https://github.com/ooni/probe/issues/1426.
This commit is contained in:
Simone Basso 2021-03-25 15:18:29 +01:00 committed by GitHub
commit c94721d9e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 13 deletions

View file

@ -97,7 +97,7 @@ func (r *Resolver) newresolver(URL string) (childResolver, error) {
func (r *Resolver) getresolver(URL string) (childResolver, error) {
defer r.mu.Unlock()
r.mu.Lock()
if re, found := r.res[URL]; found == true {
if re, found := r.res[URL]; found {
return re, nil // already created
}
re, err := r.newresolver(URL)