Skip to content

Commit a52c446

Browse files
committed
Fix header check order
1 parent 83b9b1e commit a52c446

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Utopia/Messaging/Adapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ protected function request(
8181
$ch = \curl_init();
8282

8383
foreach ($headers as $header) {
84-
if (\str_contains('application/json', $header)) {
84+
if (\str_contains($header, 'application/json')) {
8585
$body = \json_encode($body);
8686
break;
8787
}
88-
if (\str_contains('application/x-www-form-urlencoded', $header)) {
88+
if (\str_contains($header, 'application/x-www-form-urlencoded')) {
8989
$body = \http_build_query($body);
9090
break;
9191
}
@@ -153,13 +153,13 @@ protected function requestMulti(
153153
}
154154

155155
foreach ($headers as $header) {
156-
if (\str_contains('application/json', $header)) {
156+
if (\str_contains($header, 'application/json')) {
157157
foreach ($bodies as $i => $body) {
158158
$bodies[$i] = \json_encode($body);
159159
}
160160
break;
161161
}
162-
if (\str_contains('application/x-www-form-urlencoded', $header)) {
162+
if (\str_contains($header, 'application/x-www-form-urlencoded')) {
163163
foreach ($bodies as $i => $body) {
164164
$bodies[$i] = \http_build_query($body);
165165
}

0 commit comments

Comments
 (0)