aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-24 01:35:29 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-24 01:35:29 +0800
commite0bea23c20e32a7f4632671cbb7ac1748f7f2930 (patch)
tree330128d3813cad2862c20a275ded9e59da7c5f23
parentmain.go: Secure cookie (diff)
downloadpowxy-e0bea23c20e32a7f4632671cbb7ac1748f7f2930.tar.gz
powxy-e0bea23c20e32a7f4632671cbb7ac1748f7f2930.tar.zst
powxy-e0bea23c20e32a7f4632671cbb7ac1748f7f2930.zip
Revert "identifier.go: Remove many elements (some mobile browsers mess it up?)"v0.1.6
This reverts commit c752e8159e7dcfb531bbc1a7a190f61c7c0072cc. Problem was Safari using multiple IPs for the same session or something
-rw-r--r--identifier.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/identifier.go b/identifier.go
index 785f408..6da0e7c 100644
--- a/identifier.go
+++ b/identifier.go
@@ -23,10 +23,10 @@ func makeIdentifierMAC(request *http.Request) (identifier []byte, mac []byte) {
h := sha256.New()
h.Write(timeBuf)
h.Write(stringToBytes(remoteIP))
- // h.Write(stringToBytes(request.Header.Get("User-Agent")))
- // h.Write(stringToBytes(request.Header.Get("Accept-Encoding")))
- // h.Write(stringToBytes(request.Header.Get("Accept-Language")))
- // h.Write(privkeyHash)
+ h.Write(stringToBytes(request.Header.Get("User-Agent")))
+ h.Write(stringToBytes(request.Header.Get("Accept-Encoding")))
+ h.Write(stringToBytes(request.Header.Get("Accept-Language")))
+ h.Write(privkeyHash)
identifier = h.Sum(identifier)
if len(identifier) != sha256.Size {
panic("unexpected buffer length after hashing contents")