]> Cypherpunks repositories - gostls13.git/commit
net/http: continue using referer header if it's present
authorPaschalis Tsilias <paschalis.tsilias@gmail.com>
Mon, 15 Feb 2021 13:55:28 +0000 (15:55 +0200)
committerGopher Robot <gobot@golang.org>
Fri, 24 Mar 2023 00:52:03 +0000 (00:52 +0000)
commit10c2348602a3bc44b9b352fe95a18b83b025e367
tree96be62cec92bb11efec0fb4278ea352471bfc817
parentd633f4b996dadb6b72c2c43d35092738b7c19e7f
net/http: continue using referer header if it's present

Currently, net/http replaces the Referer header with the URL of the
previous request, regardless of its status. This CL changes this
behavior, respecting the Referer header for secure connections, if it is
set.

Fixes #44160

Change-Id: I2d7fe37dd681549136329e832188294691584870
Reviewed-on: https://go-review.googlesource.com/c/go/+/291636
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nick Craig-Wood <nickcw@gmail.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/net/http/client.go
src/net/http/client_test.go