Skip to content

Commit 8b35fd9

Browse files
committed
Improve code
1 parent 7f7fa2a commit 8b35fd9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"suggest": {
7676
"spiral/roadrunner-cli": "Provides RoadRunner installation and management CLI tools",
77-
"ext-protobuf": "Provides Protocol Buffers support"
77+
"ext-protobuf": "Provides Protocol Buffers support. Without it, performance will be lower."
7878
},
7979
"config": {
8080
"sort-packages": true

src/HttpWorker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function waitRequest(): ?Request
6363
}
6464

6565
if (static::$codec === null) {
66-
static::$codec = json_validate($payload->header) ? Frame::CODEC_JSON : Frame::CODEC_PROTO;
66+
static::$codec = \json_validate($payload->header) ? Frame::CODEC_JSON : Frame::CODEC_PROTO;
6767
}
6868

6969
if (static::$codec === Frame::CODEC_PROTO) {
@@ -198,7 +198,7 @@ private function requestFromProto(string $body, RequestProto $message): Request
198198
$this->headerValueToArray($message->getAttributes()),
199199
),
200200
query: $query,
201-
body: $message->getParsed() && empty($body) ? \json_encode([]) : $body,
201+
body: $message->getParsed() && empty($body) ? '{}' : $body,
202202
parsed: $message->getParsed(),
203203
);
204204
}

0 commit comments

Comments
 (0)