We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d6cad6 commit af97090Copy full SHA for af97090
1 file changed
packages/adapters/nestjs/src/index.ts
@@ -121,12 +121,15 @@ export class ObjectStackController {
121
if (req.headers) {
122
Object.entries(req.headers).forEach(([k, v]) => {
123
if (typeof v === 'string') headers.set(k, v);
124
+ else if (Array.isArray(v)) headers.set(k, v.join(', '));
125
});
126
}
127
const init: RequestInit = { method: req.method, headers };
128
if (req.method !== 'GET' && req.method !== 'HEAD' && body) {
129
init.body = JSON.stringify(body);
- headers.set('content-type', 'application/json');
130
+ if (!headers.has('content-type')) {
131
+ headers.set('content-type', 'application/json');
132
+ }
133
134
const webRequest = new Request(url, init);
135
const response = await authService.handleRequest(webRequest);
0 commit comments