Skip to content

Cannot resolve requests containing cookies in Kubernetes #33735

@rob-oberbeck

Description

@rob-oberbeck

Versions:

  • Spring Boot 3.0.1
  • Spring Cloud 2022.0.0
  • Kubernetes v1.22.11

Description:
Spring application cannot resolve requests containing cookies when running in a Kubernetes cluster.
However, running the application locally from the IDE works just fine.
Did not experience this issue with Spring Boot 2.7.6 and Spring Cloud 2021.0.5.

Given the application is deployed in a Kubernetes cluster, the following requests have been sent from the pod itself.

Request without a cookie:

curl 'http://localhost:80/management/health' 
{"status":"UP","groups":["liveness","readiness"]}

Request with cookie:

curl 'http://localhost:80/management/health' -H 'cookie: foo=bar'                                                                                                   
{"timestamp":"2023-01-09T14:15:48.105+00:00","status":404,"error":"Not Found","path":"barnagement/health"}

Server log:

{
   "timestamp":"2023-01-09 14:21:51.840",
   "logger":"org.springframework.web.servlet.PageNotFound",
   "level":"WARN",
   "message":"No mapping for foo barnagement/health"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions