Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling custom headers on the server #42

Open
Baryshych opened this issue Dec 3, 2020 · 0 comments · May be fixed by #86
Open

Handling custom headers on the server #42

Baryshych opened this issue Dec 3, 2020 · 0 comments · May be fixed by #86

Comments

@Baryshych
Copy link

Hi! I have an issue with my js client sending requests with custom metadata:

commentsClient.getComments(request, metadata, function (err, res) {

I'm using lazy init (as shown in README)

  GRPCWeb.handle(CommentsService::Service) do
    require_relative '../../app/grpc/services/comments_service.rb'
    GetCommentsService.new
  end

and my _call argument is always nil

def get_comments(request, _call = nil)
    return CommentResponse.new(comment: "Hello #{request.resourceId}")

As I have seen in the Golang implementation of GRPC-web, they access headers through the _call argument. I've briefly read sources (so I might be completely wrong, sorry in advance), and its look like

Is it possible to access env or headers is the service implementation?

@chimano chimano linked a pull request Mar 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant