Don't remove the Sec-WebSocket-Key header in WebSocketUpgrade (#1972)

This commit is contained in:
David Pedersen
2023-04-30 11:55:39 +02:00
parent b7baac2638
commit 9c5f4ebe03
2 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# Unreleased
- None.
- **fixed:** Don't remove the `Sec-WebSocket-Key` header in `WebSocketUpgrade` ([#1972])
[#1972]: https://github.com/tokio-rs/axum/pull/1972
# 0.6.17 (25. April, 2023)
+3 -2
View File
@@ -391,8 +391,9 @@ where
let sec_websocket_key = parts
.headers
.remove(header::SEC_WEBSOCKET_KEY)
.ok_or(WebSocketKeyHeaderMissing)?;
.get(header::SEC_WEBSOCKET_KEY)
.ok_or(WebSocketKeyHeaderMissing)?
.clone();
let on_upgrade = parts
.extensions