Commit 513379d
authored
Implement Unwrap method to responseAdapter to properly handle HTTP event-streaming (like Server Send Events) without buffering (#1090)
Implement Unwrap method to responseAdapter to properly handle HTTP
event-streaming (like Server Send Events).
Add unit test to check if response was flushed.
<!-- Include the issue number below -->
Fixes golang/go#27816
## Proposed Changes
* GoLang developers implemented the streaming events by immediate
flushing the response if detects the proper header. However, the
response writer need to implement Flush or Unwrap methods to make it
work. responseAdapter used in loadBalancer (in reverseProxy) was not
implementing it, so SSE events were pushed to clients **only if buffers
were overloaded** (4K bytes). This change fixes this behavior.
## Release Notes
```release-note
Fixed the issue with not flushing immediately HTTP text/event-streaming in jsessionid-lb.
```2 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
243 | 278 | | |
244 | 279 | | |
245 | 280 | | |
| |||
0 commit comments