Angular Proxy and Spring Boot CORS Interaction: Cookie Forwarding Issue
0 reputation · 19 Mar 2023, 08:52 UTC
Angular Proxy vs Spring Boot CORS
In JHipster‑generated projects the Angular proxy (proxy.conf.json) forwards API calls to the Spring Boot backend during development. The backend typically registers a CORS filter that controls cross‑origin request handling. When both the proxy and filter are active, the forwarding of cookies and authorization headers is uncertain, especially when credentials are required for session persistence.
Additionally, the default caching strategy for HTTP responses relies on explicit Cache‑Control headers set in the Spring Boot layer. The proxy does not automatically inject caching directives, so developers must manually configure caching to avoid stale data.
Given these constraints, the following questions remain:
- Does the Angular proxy forward cookies when the Spring Boot CORS filter is enabled?
- Are authorization headers correctly proxied under these conditions?
- Can the proxy automatically apply Cache‑Control headers, or must they be set manually in the backend?