Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/rb/lib/thrift/transport/header_transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def bounded_inflate(compressed)
inflater.inflate(compressed, &append_chunk)
inflater.finish(&append_chunk)
buffer
rescue Zlib::DataError, Zlib::BufError
rescue Zlib::DataError, Zlib::BufError, Zlib::NeedDict
raise TransportException.new(TransportException::UNKNOWN, "Invalid ZLIB payload")
ensure
inflater.close rescue nil
Expand Down
1 change: 1 addition & 0 deletions lib/rb/spec/header_transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ def read(size)
{
"invalid" => "not-zlib",
"truncated" => Zlib::Deflate.deflate("valid payload")[0...-1],
"preset dictionary" => Zlib::Deflate.new.tap { |d| d.set_dictionary("dictionary") }.deflate("valid payload", Zlib::FINISH),
}.each do |failure_type, payload|
it "adapts #{failure_type} ZLIB payloads to the transport exception boundary" do
header_data = [
Expand Down
Loading