File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/LaunchDarkly/Impl/Integrations Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -108,17 +108,19 @@ private function createPowershellArgs(string $payloadFile): string
108108 {
109109 $ headerString = "" ;
110110 foreach ($ this ->_eventHeaders as $ key => $ value ) {
111- $ headerString .= sprintf ("'%s'='%s'; " , $ key , $ value );
111+ $ escapedKey = str_replace ("' " , "'' " , $ key );
112+ $ escapedValue = str_replace ("' " , "'' " , $ value );
113+ $ headerString .= sprintf ('"%s"="%s"; ' , $ escapedKey , $ escapedValue );
112114 }
113115
114116 $ scheme = $ this ->_ssl ? "https:// " : "http:// " ;
115117 $ args = " Invoke-WebRequest " ;
116118 $ args .= " -Method POST " ;
117119 $ args .= " -UseBasicParsing " ;
118- $ args .= " -InFile $ payloadFile " ;
119- $ args .= " -H @{ " . $ headerString . "} " ;
120+ $ args .= " -InFile ' $ payloadFile' " ;
121+ $ args .= " -H ' @{ " . $ headerString . "}' " ;
120122 $ args .= " -Uri " . escapeshellarg ($ scheme . $ this ->_host . ": " . $ this ->_port . $ this ->_path . "/bulk " );
121- $ args .= " ; Remove-Item $ payloadFile " ;
123+ $ args .= " ; Remove-Item ' $ payloadFile' " ;
122124
123125 return $ args ;
124126 }
You can’t perform that action at this time.
0 commit comments