diff --git a/docs/content/reference/dynamic-configuration/docker-labels.yml b/docs/content/reference/dynamic-configuration/docker-labels.yml index 8f23b7e7e8..b126ab96c1 100644 --- a/docs/content/reference/dynamic-configuration/docker-labels.yml +++ b/docs/content/reference/dynamic-configuration/docker-labels.yml @@ -191,7 +191,7 @@ - "traefik.http.services.service02.loadbalancer.sticky.cookie.httponly=true" - "traefik.http.services.service02.loadbalancer.sticky.cookie.maxage=42" - "traefik.http.services.service02.loadbalancer.sticky.cookie.name=foobar" -- "traefik.http.services.service02.loadbalancer.sticky.cookie.path=/" +- "traefik.http.services.service02.loadbalancer.sticky.cookie.path=foobar" - "traefik.http.services.service02.loadbalancer.sticky.cookie.samesite=foobar" - "traefik.http.services.service02.loadbalancer.sticky.cookie.secure=true" - "traefik.http.services.service02.loadbalancer.server.port=foobar" diff --git a/docs/content/reference/dynamic-configuration/file.toml b/docs/content/reference/dynamic-configuration/file.toml index 6683c84015..dc63b88194 100644 --- a/docs/content/reference/dynamic-configuration/file.toml +++ b/docs/content/reference/dynamic-configuration/file.toml @@ -55,7 +55,7 @@ httpOnly = true sameSite = "foobar" maxAge = 42 - path = "/" + path = "foobar" [[http.services.Service02.loadBalancer.servers]] url = "foobar" @@ -111,7 +111,7 @@ httpOnly = true sameSite = "foobar" maxAge = 42 - path = "/" + path = "foobar" [http.services.Service04.weighted.healthCheck] [http.middlewares] [http.middlewares.Middleware01] diff --git a/docs/content/reference/dynamic-configuration/file.yaml b/docs/content/reference/dynamic-configuration/file.yaml index ea6a6dab73..350139a584 100644 --- a/docs/content/reference/dynamic-configuration/file.yaml +++ b/docs/content/reference/dynamic-configuration/file.yaml @@ -63,7 +63,7 @@ http: httpOnly: true sameSite: foobar maxAge: 42 - path: / + path: foobar servers: - url: foobar weight: 42 @@ -112,7 +112,7 @@ http: httpOnly: true sameSite: foobar maxAge: 42 - path: / + path: foobar healthCheck: {} middlewares: Middleware01: diff --git a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml index 37e486fbcf..e9a89650f6 100644 --- a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml +++ b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml @@ -249,7 +249,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -1147,7 +1147,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -2706,7 +2706,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -2819,7 +2819,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -3008,7 +3008,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -3061,7 +3061,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value diff --git a/docs/content/reference/dynamic-configuration/kv-ref.md b/docs/content/reference/dynamic-configuration/kv-ref.md index 63880b7e4f..9d84723245 100644 --- a/docs/content/reference/dynamic-configuration/kv-ref.md +++ b/docs/content/reference/dynamic-configuration/kv-ref.md @@ -264,7 +264,7 @@ THIS FILE MUST NOT BE EDITED BY HAND | `traefik/http/services/Service02/loadBalancer/sticky/cookie/httpOnly` | `true` | | `traefik/http/services/Service02/loadBalancer/sticky/cookie/maxAge` | `42` | | `traefik/http/services/Service02/loadBalancer/sticky/cookie/name` | `foobar` | -| `traefik/http/services/Service02/loadBalancer/sticky/cookie/path` | `/` | +| `traefik/http/services/Service02/loadBalancer/sticky/cookie/path` | `foobar` | | `traefik/http/services/Service02/loadBalancer/sticky/cookie/sameSite` | `foobar` | | `traefik/http/services/Service02/loadBalancer/sticky/cookie/secure` | `true` | | `traefik/http/services/Service03/mirroring/healthCheck` | `` | @@ -283,7 +283,7 @@ THIS FILE MUST NOT BE EDITED BY HAND | `traefik/http/services/Service04/weighted/sticky/cookie/httpOnly` | `true` | | `traefik/http/services/Service04/weighted/sticky/cookie/maxAge` | `42` | | `traefik/http/services/Service04/weighted/sticky/cookie/name` | `foobar` | -| `traefik/http/services/Service04/weighted/sticky/cookie/path` | `/` | +| `traefik/http/services/Service04/weighted/sticky/cookie/path` | `foobar` | | `traefik/http/services/Service04/weighted/sticky/cookie/sameSite` | `foobar` | | `traefik/http/services/Service04/weighted/sticky/cookie/secure` | `true` | | `traefik/tcp/middlewares/TCPMiddleware01/ipAllowList/sourceRange/0` | `foobar` | diff --git a/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml b/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml index 195166817b..c127eb9e0d 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_ingressroutes.yaml @@ -249,7 +249,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value diff --git a/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml b/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml index 0b4b71a649..d6e3e593f2 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml @@ -417,7 +417,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value diff --git a/docs/content/reference/dynamic-configuration/traefik.io_traefikservices.yaml b/docs/content/reference/dynamic-configuration/traefik.io_traefikservices.yaml index ac909ad029..c582bc1a9b 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_traefikservices.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_traefikservices.yaml @@ -287,7 +287,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -400,7 +400,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -589,7 +589,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -642,7 +642,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value diff --git a/integration/fixtures/k8s/01-traefik-crd.yml b/integration/fixtures/k8s/01-traefik-crd.yml index 37e486fbcf..e9a89650f6 100644 --- a/integration/fixtures/k8s/01-traefik-crd.yml +++ b/integration/fixtures/k8s/01-traefik-crd.yml @@ -249,7 +249,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -1147,7 +1147,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -2706,7 +2706,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -2819,7 +2819,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -3008,7 +3008,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value @@ -3061,7 +3061,7 @@ spec: description: Name defines the Cookie name. type: string path: - description: |- + description: |- When path is set the cookie will only be sent for requests to the given path or subpaths. When not provided the cookie will be sent on every request to the domain. More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value diff --git a/pkg/config/label/label_test.go b/pkg/config/label/label_test.go index 64438bc380..f615c0a1eb 100644 --- a/pkg/config/label/label_test.go +++ b/pkg/config/label/label_test.go @@ -174,6 +174,7 @@ func TestDecodeConfiguration(t *testing.T) { "traefik.http.services.Service0.loadbalancer.server.port": "8080", "traefik.http.services.Service0.loadbalancer.sticky.cookie.name": "foobar", "traefik.http.services.Service0.loadbalancer.sticky.cookie.secure": "true", + "traefik.http.services.Service0.loadbalancer.sticky.cookie.path": "/foobar", "traefik.http.services.Service0.loadbalancer.serversTransport": "foobar", "traefik.http.services.Service1.loadbalancer.healthcheck.headers.name0": "foobar", "traefik.http.services.Service1.loadbalancer.healthcheck.headers.name1": "foobar", @@ -674,6 +675,7 @@ func TestDecodeConfiguration(t *testing.T) { Name: "foobar", Secure: true, HTTPOnly: false, + Path: "/foobar", }, }, Servers: []dynamic.Server{ @@ -1196,6 +1198,7 @@ func TestEncodeConfiguration(t *testing.T) { Cookie: &dynamic.Cookie{ Name: "foobar", HTTPOnly: true, + Path: "/foobar", }, }, Servers: []dynamic.Server{ @@ -1433,7 +1436,7 @@ func TestEncodeConfiguration(t *testing.T) { "traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.HTTPOnly": "true", "traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.Secure": "false", "traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.MaxAge": "0", - "traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.Path": "/", + "traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.Path": "/foobar", "traefik.HTTP.Services.Service0.LoadBalancer.ServersTransport": "foobar", "traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Headers.name0": "foobar", "traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Headers.name1": "foobar",