We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb6719f commit 76e7bc0Copy full SHA for 76e7bc0
lib/protocol/websocket/ping_frame.rb
@@ -15,7 +15,7 @@ class PingFrame < Frame
15
# Generate a suitable reply.
16
# @returns [PongFrame]
17
def reply(**options)
18
- PongFrame.new(true, self.unpack, **options)
+ PongFrame.new(true, **options).pack(self.unpack)
19
end
20
21
# Apply this frame to the specified connection.
test/protocol/websocket/ping_frame.rb
@@ -15,4 +15,16 @@
it "is a control frame" do
expect(frame).to be(:control?)
+
+ with "#reply" do
+ it "can generate an appropriately masked reply" do
+ frame.pack("Hello, World!")
22
23
+ reply = frame.reply(mask: "mask")
24
25
+ expect(reply.mask).to be == "mask"
26
+ expect(reply.payload).not.to be == "Hello, World!"
27
+ expect(reply.unpack).to be == "Hello, World!"
28
+ end
29
30
0 commit comments