Skip to content

Commit fb921c7

Browse files
committed
🚿
1 parent 7340ce8 commit fb921c7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/CurlUtils/CurlHandle.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,16 @@ protected function setHeaderOptions(array $options):array{
244244

245245
}
246246

247-
$options[CURLOPT_HTTPHEADER] = $headers;
248-
249-
// If the Expect header is not present, prevent curl from adding it
250-
if(!$this->request->hasHeader('Expect')){
251-
$options[CURLOPT_HTTPHEADER][] = 'Expect:';
252-
}
247+
// If the Expect header is not present (it isn't), prevent curl from adding it
248+
$headers[] = 'Expect:';
253249

254250
// cURL sometimes adds a content-type by default. Prevent this.
255251
if(!$this->request->hasHeader('Content-Type')){
256-
$options[CURLOPT_HTTPHEADER][] = 'Content-Type:';
252+
$headers[] = 'Content-Type:';
257253
}
258254

255+
$options[CURLOPT_HTTPHEADER] = $headers;
256+
259257
return $options;
260258
}
261259

0 commit comments

Comments
 (0)