Skip to content

Commit

Permalink
Fixed array push for single element
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 9, 2024
1 parent 2a54c9e commit ce7d790
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ public function request( $method, $url, $headers = [], $params = [] ) {
$this->curl->setOpt( $ch, CURLOPT_POSTFIELDS, $params );

if ($this->postDataFormat == 'json') {
array_push( $headers, 'Content-Type: application/json' );
$headers[] = 'Content-Type: application/json';
}
elseif ($this->postDataFormat == 'msgpack') {
array_push( $headers, 'Content-Type: application/x-msgpack' );
$headers[] = 'Content-Type: application/x-msgpack';
}
} else {
throw new AblyRequestException( 'Unknown $params format', -1, -1 );
Expand Down

0 comments on commit ce7d790

Please sign in to comment.