From 47e9c05ff1266fd25f70b5dbce2c94cc60c68aea Mon Sep 17 00:00:00 2001 From: s1lver Date: Wed, 26 Apr 2023 11:09:30 +0300 Subject: [PATCH] Fixed `put` method --- CHANGELOG.md | 3 +++ src/Etcd.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a90a39..c6c425b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog yii2 etcd component +## 1.0.5 +- Fixed `put` method + ## 1.0.4 - Removed `grpc/grpc` package from pre-implementation dependencies diff --git a/src/Etcd.php b/src/Etcd.php index 62ccb60..d251028 100644 --- a/src/Etcd.php +++ b/src/Etcd.php @@ -98,7 +98,7 @@ public function put(string $key, string $value): bool { $options = [ RequestOptions::BODY => json_encode( - ['key' => $key, 'value' => base64_encode($value)], + ['key' => base64_encode(trim($key)), 'value' => base64_encode(trim($value))], JSON_THROW_ON_ERROR ), ];