mirror of
https://github.com/foomo/sesamy-go.git
synced 2025-10-16 12:35:43 +00:00
wip: debug
This commit is contained in:
parent
8a91ffb81b
commit
56b9e9b67b
@ -1,7 +1,6 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@ -11,6 +10,7 @@ import (
|
||||
"github.com/foomo/sesamy-go/pkg/encoding/mpv2"
|
||||
"github.com/foomo/sesamy-go/pkg/provider/cookiebot"
|
||||
"go.uber.org/zap"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func MPv2MiddlewarConsent(l *zap.Logger) client.MPv2Middleware {
|
||||
@ -34,7 +34,7 @@ func MPv2MiddlewarConsent(l *zap.Logger) client.MPv2Middleware {
|
||||
}
|
||||
|
||||
var value cookiebot.Cookie
|
||||
if err := json.Unmarshal([]byte(data), &value); err != nil {
|
||||
if err := yaml.Unmarshal([]byte(data), &value); err != nil {
|
||||
l.With(zap.Error(err), zap.String("value", data)).Warn("failed to unmarshal cookie bot cookie")
|
||||
return next(r, payload)
|
||||
}
|
||||
|
||||
@ -3,13 +3,13 @@ package cookiebot
|
||||
const CookieName = "CookieConsent"
|
||||
|
||||
type Cookie struct {
|
||||
Stamp string `json:"stamp"`
|
||||
Necessary bool `json:"necessary"`
|
||||
Preferences bool `json:"preferences"`
|
||||
Statistics bool `json:"statistics"`
|
||||
Marketing bool `json:"marketing"`
|
||||
Method string `json:"method"`
|
||||
Version string `json:"ver"`
|
||||
UTC int `json:"utc"`
|
||||
Region string `json:"region"`
|
||||
Stamp string `json:"stamp" yaml:"stamp"`
|
||||
Necessary bool `json:"necessary" yaml:"necessary"`
|
||||
Preferences bool `json:"preferences" yaml:"preferences"`
|
||||
Statistics bool `json:"statistics" yaml:"statistics"`
|
||||
Marketing bool `json:"marketing" yaml:"marketing"`
|
||||
Method string `json:"method" yaml:"method"`
|
||||
Version string `json:"ver" yaml:"ver"`
|
||||
UTC int `json:"utc" yaml:"utc"`
|
||||
Region string `json:"region" yaml:"region"`
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user