From a321154996da6cb0c3e863c140950942427f6f94 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 2 Jul 2021 08:51:57 -0500 Subject: [PATCH] fix: use :erlang.bxor/2 instead of Bitwise.bxor/2 (#18) * use :erlang.bxor/2 instead of Bitwise.bxor/2 * add change notes to changelog --- CHANGELOG.md | 7 +++++++ lib/mint/web_socket/frame.ex | 2 +- lib/mint/web_socket/per_message_deflate.ex | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 742f6824..45adf87e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.1.2 - 2021-07-02 + +### Fixed + +- Switch from using `Bitwise.bxor/2` to `:erlang.bxor/2` for compatibility + with Elixir < 1.10 + ## 0.1.1 - 2021-07-01 ### Fixed diff --git a/lib/mint/web_socket/frame.ex b/lib/mint/web_socket/frame.ex index a10cc5d8..6ea24db1 100644 --- a/lib/mint/web_socket/frame.ex +++ b/lib/mint/web_socket/frame.ex @@ -156,7 +156,7 @@ defmodule Mint.WebSocket.Frame do apply_mask( payload_rest, mask, - <> + <> ) end end diff --git a/lib/mint/web_socket/per_message_deflate.ex b/lib/mint/web_socket/per_message_deflate.ex index 5d5f47dc..543a6a2f 100644 --- a/lib/mint/web_socket/per_message_deflate.ex +++ b/lib/mint/web_socket/per_message_deflate.ex @@ -90,7 +90,7 @@ defmodule Mint.WebSocket.PerMessageDeflate do frame = Frame.unquote(opcode)(frame, - reserved: <>, + reserved: <<:erlang.bxor(reserved, 0b100)::size(3)>>, data: data )