diff --git a/validator_fingerprint.go b/validator_fingerprint.go index 4ce04ab..0b85926 100644 --- a/validator_fingerprint.go +++ b/validator_fingerprint.go @@ -1,9 +1,17 @@ package berghain +import "net/http" + const validatorFingerprintResponse = `{"t": 2}` func validatorFingerprint(b *Berghain, req *ValidatorRequest, resp *ValidatorResponse) error { - copy(resp.Body.WriteNBytes(len(validatorFingerprintResponse)), validatorFingerprintResponse) + switch req.Method { + case http.MethodGet: + copy(resp.Body.WriteNBytes(len(validatorFingerprintResponse)), validatorFingerprintResponse) + return nil + case http.MethodPost: + return req.Identifier.ToCookie(b, resp.Token) + } - return req.Identifier.ToCookie(b, resp.Token) + return nil } diff --git a/web/index.html b/web/index.html index a0625f8..e5a4891 100644 --- a/web/index.html +++ b/web/index.html @@ -42,5 +42,6 @@