lib/httpx/plugins/grpc/message.rb in httpx-0.17.0 vs lib/httpx/plugins/grpc/message.rb in httpx-0.18.0
- old
+ new
@@ -15,11 +15,11 @@
decode(response.to_s, encodings: response.headers.get("grpc-encoding"), encoders: response.encoders)
end
# lazy decodes a grpc stream response
def stream(response, &block)
- return enum_for(__method__, response) unless block_given?
+ return enum_for(__method__, response) unless block
response.each do |frame|
decode(frame, encodings: response.headers.get("grpc-encoding"), encoders: response.encoders, &block)
end
@@ -55,10 +55,10 @@
return data unless block_given?
yield data
- message = message.byteslice(5 + size..-1)
+ message = message.byteslice((5 + size)..-1)
end
end
def cancel(request)
request.emit(:refuse, :client_cancellation)