Prerequisites
Fastify version
4.23.2
Plugin version
No response
Node.js version
20.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.0
Description
The .inject() method allows to inject request headers which values can be a string or an array of strings. When an array is used, it gets serialized to an comma-separated string.
Steps to Reproduce
await fastifyInstance.inject({ method: 'get', url: '/', headers: { foo: 'bar', baz: ['first', 'second'] } });
gives me the following request headers in the route handler:
{
baz: 'first,second',
foo: 'bar',
host: 'localhost:80',
'user-agent': 'lightMyRequest'
}
Expected Behavior
I would expect to get an array of strings in the route handler as well.
Prerequisites
Fastify version
4.23.2
Plugin version
No response
Node.js version
20.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.0
Description
The
.inject()method allows to inject request headers which values can be a string or an array of strings. When an array is used, it gets serialized to an comma-separated string.Steps to Reproduce
gives me the following request headers in the route handler:
Expected Behavior
I would expect to get an array of strings in the route handler as well.