Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Apr 1, 2024
1 parent 7f7fa2a commit 8b35fd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"suggest": {
"spiral/roadrunner-cli": "Provides RoadRunner installation and management CLI tools",
"ext-protobuf": "Provides Protocol Buffers support"
"ext-protobuf": "Provides Protocol Buffers support. Without it, performance will be lower."
},
"config": {
"sort-packages": true
Expand Down
4 changes: 2 additions & 2 deletions src/HttpWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function waitRequest(): ?Request
}

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

if (static::$codec === Frame::CODEC_PROTO) {
Expand Down Expand Up @@ -198,7 +198,7 @@ private function requestFromProto(string $body, RequestProto $message): Request
$this->headerValueToArray($message->getAttributes()),
),
query: $query,
body: $message->getParsed() && empty($body) ? \json_encode([]) : $body,
body: $message->getParsed() && empty($body) ? '{}' : $body,
parsed: $message->getParsed(),
);
}
Expand Down

0 comments on commit 8b35fd9

Please sign in to comment.