lightninglabs / aperture

⚡️L402 (Lightning HTTP 402) Reverse Proxy ⚡️
http://l402.tech/
MIT License
233 stars 58 forks source link

proxy: always return 200 status code to gRPC client #102

Closed guggero closed 1 year ago

guggero commented 1 year ago

Fixes https://github.com/lightninglabs/aperture/issues/62.

It turns out that sending a non-200 HTTP status code was against the gRPC spec and the older versions of the grpc library just didn't validate that. The validation was added in v1.40.0, which is the version that we couldn't update to before. With this fix the error is still parsed correctly on the client side. But this requires a small change to the L402 spec because the status code is no longer 402.

See https://github.com/grpc/grpc-go/pull/4474 and https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses.

I'll also open a PR in the L402 spec repo and will test this in one of our server integration test setups.

guggero commented 1 year ago

I verified that this works with both the Loop and Pool server backend integration tests :tada: