Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/http/2/framer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def common_header(frame, buffer:)

stream_id = frame.fetch(:stream, 0)

raise CompressionError, "Stream ID (#{stream_id}) is too large" if stream_id > MAX_STREAM_ID
raise CompressionError, "Stream ID (#{stream_id}) is outside the valid range" unless stream_id.between?(0, MAX_STREAM_ID)

if type == :window_update && frame[:increment] > MAX_WINDOWINC
raise CompressionError, "Window increment (#{frame[:increment]}) is too large"
if type == :window_update && !frame[:increment].between?(1, MAX_WINDOWINC)
raise CompressionError, "Window increment (#{frame[:increment]}) is outside the valid range"
end

flags = frame[:flags]
Expand Down