Commit 8733b96
committed
bug #62502 [HttpFoundation] Fix Expires response header for EventStream (4513)
This PR was squashed before being merged into the 7.3 branch.
Discussion
----------
[HttpFoundation] Fix Expires response header for EventStream
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | yes
| New feature? |no
| Deprecations? |no
| Issues | -
| License | MIT
This PR fixes name of the HTTP response header 'Expires' for Event Stream Response, which is currently missing an 's'. Because of the typo, a server may assume that the 'Expires' header is not set and add its own one.
There may be an old agents that do not check Cache-Control and only use value of Expires header, leading into incorrect caching of the response. Some servers tend to set Expires value to a future.
This fix is applicable to 7.3, 7.4, 8.x. The SSE has not been implemented before 7.3 and is not present in 6.x.
One of the responses when using SSE (notice the expire and the expires headers):
```
HTTP/2 200
cache-control: max-age=0, must-revalidate, no-cache, no-store, private
x-accel-buffering: no
pragma: no-cache
expire: 0
date: Mon, 24 Nov 2025 17:01:30 GMT
cache-control: max-age=604800
expires: Mon, 01 Dec 2025 17:01:29 GMT
content-type: text/event-stream; charset=UTF-8
server: Apache
...
```
*WIP: Missing tests*
Commits
-------
b830108 [HttpFoundation] Fix Expires response header for EventStreamFile tree
2 files changed
+9
-1
lines changed- src/Symfony/Component/HttpFoundation
- Tests
2 files changed
+9
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
| |||
0 commit comments