Skip to content

Commit

Permalink
Don't remove the Sec-WebSocket-Key header in WebSocketUpgrade (#1972
Browse files Browse the repository at this point in the history
)
  • Loading branch information
davidpdrsn committed Apr 30, 2023
1 parent b7baac2 commit 9c5f4eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion axum/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions axum/src/extract/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c5f4eb

Please sign in to comment.