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
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -11,6 +10,7 @@ import (
|
|||||||
"github.com/foomo/sesamy-go/pkg/encoding/mpv2"
|
"github.com/foomo/sesamy-go/pkg/encoding/mpv2"
|
||||||
"github.com/foomo/sesamy-go/pkg/provider/cookiebot"
|
"github.com/foomo/sesamy-go/pkg/provider/cookiebot"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MPv2MiddlewarConsent(l *zap.Logger) client.MPv2Middleware {
|
func MPv2MiddlewarConsent(l *zap.Logger) client.MPv2Middleware {
|
||||||
@ -34,7 +34,7 @@ func MPv2MiddlewarConsent(l *zap.Logger) client.MPv2Middleware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var value cookiebot.Cookie
|
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")
|
l.With(zap.Error(err), zap.String("value", data)).Warn("failed to unmarshal cookie bot cookie")
|
||||||
return next(r, payload)
|
return next(r, payload)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,13 +3,13 @@ package cookiebot
|
|||||||
const CookieName = "CookieConsent"
|
const CookieName = "CookieConsent"
|
||||||
|
|
||||||
type Cookie struct {
|
type Cookie struct {
|
||||||
Stamp string `json:"stamp"`
|
Stamp string `json:"stamp" yaml:"stamp"`
|
||||||
Necessary bool `json:"necessary"`
|
Necessary bool `json:"necessary" yaml:"necessary"`
|
||||||
Preferences bool `json:"preferences"`
|
Preferences bool `json:"preferences" yaml:"preferences"`
|
||||||
Statistics bool `json:"statistics"`
|
Statistics bool `json:"statistics" yaml:"statistics"`
|
||||||
Marketing bool `json:"marketing"`
|
Marketing bool `json:"marketing" yaml:"marketing"`
|
||||||
Method string `json:"method"`
|
Method string `json:"method" yaml:"method"`
|
||||||
Version string `json:"ver"`
|
Version string `json:"ver" yaml:"ver"`
|
||||||
UTC int `json:"utc"`
|
UTC int `json:"utc" yaml:"utc"`
|
||||||
Region string `json:"region"`
|
Region string `json:"region" yaml:"region"`
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user