feat(bring): send X-Bring-Client-URL header on booking reqs, defaulting to https://sshops.uk and overridable via BRING_CLIENT_URL env var

This commit is contained in:
2026-05-22 20:02:43 +02:00
parent 2e6dda190f
commit 19e493a3d5

View File

@@ -187,6 +187,11 @@ func (c *BookingClient) doJSON(ctx context.Context, url string, body any, out an
req.Header.Set("X-Mybring-API-Uid", c.apiUID)
req.Header.Set("X-Mybring-API-Key", c.apiKey)
req.Header.Set("X-Mybring-API-Customer-Number", c.customerNumber)
clientURL := os.Getenv("BRING_CLIENT_URL")
if clientURL == "" {
clientURL = "https://sshops.uk"
}
req.Header.Set("X-Bring-Client-URL", clientURL)
resp, err := c.httpClient.Do(req)
if err != nil {