ruby-protobuf / protobuf

A pure ruby implementation of Google's Protocol Buffers
https://github.com/ruby-protobuf
MIT License
462 stars 101 forks source link

Ensure server is always set on a response proto #426

Closed film42 closed 2 years ago

film42 commented 2 years ago

The scenario was that we found PbError in the exception handler middleware does not set the server from the env, but it does do it in the response encoder middleware. It seems appropriate to add it to the exception handler middleware as well because without this, a fail RuntimeError, "yolo" would not have a server hostname, and would display the default host/port combo defined in the base connector class which is 127.0.0.1:9399 which is almost always wrong, unless you're actually using the socket connector, which to my knowledge, nobody is.

Thanks @moveson for helping!