Just wanted to share the solution i found for accessing raw body
add this section to your settings.js, replaving /this/that with the path you'd like to get raw body :
httpNodeMiddleware: (req, res, next) => {
const rawPaths = ['/this/that'];
if (rawPaths.includes(req.url)) {
req.headers['content-type'] = 'application/octet-stream';
}
next();
},
This seems to be solving the issue and msg.payload is now a buffer.
It worked fine on verifying apple app store connect events
That's a good tip. We have got an open PR with a proposed solution for this that doesn't require updating the settings file (so handy in environments where you can't customise your settings file). It does slightly scary things with node streams and I haven't had the time to fully validate it yet.
dev
← debadutta98:@feature/issue-5029
opened 04:27PM - 05 Feb 25 UTC
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-… breaking change which adds functionality)
## Proposed changes
This PR Closes: #5029
## How is it implemented?
This PR allows users to access the raw request body by accessing it from the request object. It achieves this by programmatically adding middleware at the top of the app's route stack.
When a request is received, the middleware is triggered and attaches event listeners to the request stream. These listeners clone the stream, preserving the original data so it can be consumed later and converted into raw data.
## What happens after the request passes through middleware?
When a new HTTP In node is initialized, I generate its unique route key and store it in a hash set. Later, when an incoming request passes through the middleware, I check whether the route key exists in the hash set. If the key does not exist, there's no need to clone the request stream. However, if the key is found, I clone the stream to preserve the raw request data.

## Checklist
- [x] I have read the [contribution guidelines](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
- [ ] For non-bugfix PRs, I have discussed this change on the forum/slack team.
- [x] I have run `npm run test` to verify the unit tests pass
- [ ] I have added suitable unit tests to cover the new/changed functionality
The proposed solution here would keep msg.payload
as the parsed body, but allow you to also access the raw version on a separate property.
Perhaps your solution is a cleaner choice - avoids having two copies of the data in the message.