Skip to content

Commit

Permalink
Fix invalid websocket challenge verification
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Aug 15, 2024
1 parent bbd3e92 commit 0b635de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Add missing `require "http"`
- Add missing `require "http/web_socket"`
- Fix invalid websocket challenge verification

## [1.0.0] - 2023-05-29

Expand Down
2 changes: 1 addition & 1 deletion src/lester.cr
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Lester
# Adapted from `HTTP::Websocket::Protocol.new`
private def websocket_for_unix_socket(uri, headers)
socket.try do |socket|
key = Random::Secure.base64(16)
key = Base64.strict_encode(StaticArray(UInt8, 16).new { rand(256).to_u8 })

headers["Host"] = "#{uri.host}:#{uri.port}"
headers["Connection"] = "Upgrade"
Expand Down

0 comments on commit 0b635de

Please sign in to comment.