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

Grpc send metadata #5142

Closed
wants to merge 6 commits into from
Closed

Conversation

AlexDaSoul
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Cannot send metadata from @GrpcMethod

Issue Number: #1897

What is the new behavior?

Example of usage:

import { Metadata } from 'grpc';

@GrpcMethod('Service', 'Method')
public method(request: any, metadata: Metadata, sendMetadata: Function): any {
   // 1. nothing to do with request that is empty in this case
   // 2. may something with metadata from client if needed
   // 3. send metadata with responce........
   const srvMetadata = new Metadata();

   srvMetadata.add('Set-Cookie', 'yummy_cookie=choco');

   sendMetadata(srvMetadata);

   return 'Hello World!!!';
}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

alex and others added 6 commits July 22, 2020 15:16
example of usage:

import { Metadata } from 'grpc';

@GrpcMethod('Service', 'Method')
public method(request: any, metadata: Metadata, sendMetadata: any): any {
   // 1. nothing to do with request that is empty in this case
   // 2. may something with metadata from client if needed
   // 3. send metadata with responce........
   const srvMetadata = new Metadata();

   srvMetadata.add('Set-Cookie', 'yummy_cookie=choco');

   sendMetadata(srvMetadata);

   return 'Hello World!!!';
}
@AlexDaSoul AlexDaSoul closed this Jul 24, 2020
@AlexDaSoul AlexDaSoul deleted the grpc-send-metadata branch July 24, 2020 07:22
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 this pull request may close these issues.

2 participants