From 564eb8882316210b42a83195bf20a6215a976f1f Mon Sep 17 00:00:00 2001 From: wavpro <31097540+wavpro@users.noreply.github.com> Date: Fri, 8 Apr 2022 15:03:45 +0200 Subject: [PATCH] Update php.js CURLOPTS_HTTPHEADER doesn't exist, instead use CURLOPT_HTTPHEADER. Headers need to be strings, and there are no single qoutes present in the generated code. --- src/lib/generateCode/targets/php.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/generateCode/targets/php.js b/src/lib/generateCode/targets/php.js index e0f0aeb..ab4a997 100644 --- a/src/lib/generateCode/targets/php.js +++ b/src/lib/generateCode/targets/php.js @@ -38,11 +38,11 @@ curl_setopt_array($curl, array( } if (req.authHeader) { - headers.push(`${req.authHeader.name}: ${req.authHeader.value}`); + headers.push(`'${req.authHeader.name}: ${req.authHeader.value}'`); } if (headers.length) { - opts.push(`CURLOPTS_HTTPHEADER => array( + opts.push(`CURLOPT_HTTPHEADER => array( ${headers.join(',\n ')} )`); }