Skip to content

Commit 219f2cf

Browse files
committed
feature: made possible to append extra response http headers in PerformServerUpgrade stage (#31)
PR by [lifeengines](chronoxor/NetCoreServer#297) to fix [bramley-jetcharge issue](chronoxor/NetCoreServer#328)
1 parent 82f3929 commit 219f2cf

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

release.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ Notes :
1818
- sync `HttpMultipartDataParser` library with upstream
1919

2020

21+
## v13.1.0 / _(2025-04-??)_
22+
Maintenance
23+
24+
### feature
25+
26+
- made possible to append extra response http headers in PerformServerUpgrade stage (#31), PR by [lifeengines](https://github.com/chronoxor/NetCoreServer/pull/297) to fix [bramley-jetcharge
27+
issue](https://github.com/chronoxor/NetCoreServer/issues/328)
28+
29+
2130
## v13.0.0 / _(2025-02-14)_
2231
Maintenance
2332

src/SimpleW/NetCoreServer/WebSocket.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,14 @@ public bool PerformServerUpgrade(HttpRequest request, HttpResponse response)
231231
response.SetHeader("Connection", "Upgrade");
232232
response.SetHeader("Upgrade", "websocket");
233233
response.SetHeader("Sec-WebSocket-Accept", accept);
234-
response.SetBody();
235234

236235
// Validate WebSocket upgrade request and response
237236
if (!_wsHandler.OnWsConnecting(request, response))
238237
return false;
239238

239+
// set body here to allow OnWsConnecting() add custom headers
240+
response.SetBody();
241+
240242
// Send WebSocket upgrade response
241243
_wsHandler.SendUpgrade(response);
242244

0 commit comments

Comments
 (0)