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.
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.