fix(measurex): make sure we don't redirect loop forever (#532)

This is the most immediate fix to the issue described by
https://github.com/ooni/probe/issues/1792.

So, the logic was actually miss the increment, which
would have been noticed with proper unit testing.

Anyway, I am not sure why the loop ensues in the first
time. By looking at the headers, it seems we're passing
the headers correctly.

So, even though this fix interrupts the loop, it still
remains the question of whether the loop is legit or
whether we're missing extra logic to properly redirect.
This commit is contained in:
Simone Basso 2021-09-30 14:07:25 +02:00 committed by GitHub
parent ba9151d4fa
commit 86018ecb82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -885,6 +885,7 @@ type redirectionQueue struct {
func (r *redirectionQueue) append(URL ...string) {
r.q = append(r.q, URL...)
r.cnt++
}
func (r *redirectionQueue) popleft() (URL string) {