diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-24 01:35:29 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-24 01:35:29 +0800 |
commit | e0bea23c20e32a7f4632671cbb7ac1748f7f2930 (patch) | |
tree | 330128d3813cad2862c20a275ded9e59da7c5f23 | |
parent | main.go: Secure cookie (diff) | |
download | powxy-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.go | 8 |
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") |