Plugin string set by request.setBody cuts after u0000 charter
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
### Expected Behavior
1. When in module.exports.requestHooks I set to context.request.setBody the string which contains \u0000 character I expect that whole data in body will be send by network
### Actual Behavior
If string contains \u0000 character Insomnia sends by network http request with body cutted till this character.
### Reproduction Steps
1. Create your plugin
2. make hook module.exports.requestHooks
3. change request body with context.request.setBody and set text property to string which contains \u0000 character
4. trace network
### 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
_No response_
### Insomnia Version
2023.4.0
### What operating system are you using?
Windows
### Operating System Version
Windows 10
### Installation method
download from insomnia.rest
### Last Known Working Insomnia version
_No response_
Contributor guide
Research direction
Start by reproducing the Windows 10 case with a plugin request hook using context.request.setBody and a string containing \u0000. Trace the requestHooks and setBody handling mentioned in the report, then verify that the complete body, including data after the null character, is sent over the network.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100