diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2025-03-11 18:56:25 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2025-03-11 18:56:25 +0100 |
commit | c0fad35e1e4a60f0615bd04af052860e386b974b (patch) | |
tree | 7468f91fc5ac8be6ae5e8c29953c709dcb98e154 | |
parent | 0cfc1759e5548dcfb133a6268c5d49976871cd43 (diff) |
fix: Attribute OL with the domain we arrived at
-rw-r--r-- | main.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -129,6 +129,15 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question } defer rsp.Body.Close() + // We're using an HTTP client that follows redirects. Ensure that we're + // attributing any found Onion-Location header with the domain name we were + // redirected too, rather than the original domain name that we started + // from. If there are no redirects this assignment doesn't change anything. + // + // More details on why this behavior matters: + // https://gitlab.torproject.org/tpo/onion-services/onion-grab/-/issues/1 + answer.Domain = rsp.Request.URL.Host + onion, ok := onionloc.HTTP(rsp) if ok { answer.HTTP = onion |