Skip to content

bug: grpc-web plugin causing missing trailers issue #10573

@Affanmir

Description

@Affanmir

Current Behavior

When i use the grpc-web plugin and cors plugin to communicate from my fronted to my backend, the response I receive an error missing trailers. I've tried the same thing using envoy and it works. There seems to be some misconfiguration is the response body which does not allow the response to

Expected Behavior

Screenshot 2023-11-28 at 10 52 01 AM

Envoy Response: (CORRECT AND DOES NOT CAUSE ISSUE)

Hello! Mohsin Javed� grpc-status:0
grpc-message:OK

Headers:

HTTP/1.1 200 OK
content-type: application/grpc-web+proto
grpc-accept-encoding: identity,deflate,gzip
grpc-encoding: identity
date: Fri, 24 Nov 2023 06:04:45 GMT
x-envoy-upstream-service-time: 12
access-control-allow-origin: http://localhost:58653/
access-control-expose-headers: custom-header-1,grpc-status,grpc-message
server: envoy
transfer-encoding: chunked

API SIX Response:: (INCORRECT

AND CAUSES ISSUE MISSING TRAILERS)

Hello! World

Headers:
HTTP/1.1 200 OK
Date: Fri, 24 Nov 2023 06:13:48 GMT
Content-Type: application/grpc-web+proto
Transfer-Encoding: chunked
Connection: keep-alive
grpc-accept-encoding: identity,deflate,gzip
grpc-encoding: identity
Server: APISIX/3.6.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: *
Access-Control-Max-Age: 5
Access-Control-Expose-Headers: *
Access-Control-Allow-Headers: *

Error Logs

Screenshot 2023-11-30 at 7 05 22 PM

Steps to Reproduce

enable grpc-web and cors plugin on a route that communicates from any frontend / backend service that implemented a grpc service using a proto definition.

Environment

Please take a clone of this mmj-dev-git/grpc_with_envoy_and_apisix#1 All steps to reproduce are mentioned in the README.md

This is a small local setup with node as the back end and flutter as the frontend

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions