Kong / Kong/insomnia

gRPC Request: Headers ending with -bin does not convert value to Buffer object.

Open
#4,688 0 comments 0 reactions 0 assignees View on GitHub
A-grpc B-bug S-verified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

Adding a new header ending with '-bin' should convert the 'Value' column value into Buffer object.

### Actual Behavior

When sending a request, the following error is shown:

![image](https://user-images.githubusercontent.com/600505/162880276-d4609e3d-667a-46f2-8a55-f536340d8912.png)

### Reproduction Steps

1. Create 'New Request'
2. Select 'gRPC'
3. Select folder/file containing protos
4. Enter valid url pointing to grpc service
5. Select method to execute
6. Selected 'Headers' tab
7. Add new header, make sure it ends with '-bin'. Example: 'x-custom-bin'
8. Supply base64 value
9. Click 'Send'

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

Reproduced on macOS as well.

I did some digging and this is required by grpc-js package. Even though it isn't the 'right' fix, it did seem fairly easy to detect that header ends with '-bin' and converting the base64 value into a Buffer object. Then everything works great (in my own tests)

### Insomnia Version

2022.2.1

### What operating system are you using?

Windows

### Operating System Version

Windows 10

### Installation method

Download from insomnia.net

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the gRPC request path that assembles outgoing headers and inspect how grpc-js receives header values. Reproduce the request with a base64 value in a header ending in '-bin', then add coverage for the expected binary value and verify the request succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.