From 86018ecb82412b0532a482b30ce6abb017aeb054 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Thu, 30 Sep 2021 14:07:25 +0200 Subject: [PATCH] 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. --- internal/measurex/measurer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/measurex/measurer.go b/internal/measurex/measurer.go index 09b8db4..542afab 100644 --- a/internal/measurex/measurer.go +++ b/internal/measurex/measurer.go @@ -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) {