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
56b9e9b67b
commit
9673d35bc3
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/foomo/sesamy-go/pkg/client"
|
"github.com/foomo/sesamy-go/pkg/client"
|
||||||
@ -34,7 +35,7 @@ func MPv2MiddlewarConsent(l *zap.Logger) client.MPv2Middleware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var value cookiebot.Cookie
|
var value cookiebot.Cookie
|
||||||
if err := yaml.Unmarshal([]byte(data), &value); err != nil {
|
if err := yaml.Unmarshal([]byte(strings.ReplaceAll(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)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package cookiebot
|
|||||||
|
|
||||||
const CookieName = "CookieConsent"
|
const CookieName = "CookieConsent"
|
||||||
|
|
||||||
|
// {stamp:'VLZnHUKBPLqZCJyClLLmnGglmUPeZsGxrmiAEZ48i7UH39ptKHY4MA==',necessary:true,preferences:true,statistics:true,marketing:true,method:'explicit',ver:1,utc:1724770548958,region:'de'}
|
||||||
type Cookie struct {
|
type Cookie struct {
|
||||||
Stamp string `json:"stamp" yaml:"stamp"`
|
Stamp string `json:"stamp" yaml:"stamp"`
|
||||||
Necessary bool `json:"necessary" yaml:"necessary"`
|
Necessary bool `json:"necessary" yaml:"necessary"`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user