From 557af82f932632d835af34d3efda785a2b80e2e1 Mon Sep 17 00:00:00 2001 From: Mark <14284867+xHeaven@users.noreply.github.com> Date: Sun, 24 Nov 2024 23:12:58 +0100 Subject: [PATCH] Make shop domain safer --- src/Services/RateLimitService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Services/RateLimitService.php b/src/Services/RateLimitService.php index 9ff6ef2..3b9c5a1 100644 --- a/src/Services/RateLimitService.php +++ b/src/Services/RateLimitService.php @@ -7,6 +7,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\Redis; use Illuminate\Support\Sleep; +use Illuminate\Support\Str; class RateLimitService { @@ -14,7 +15,8 @@ class RateLimitService public function __construct(private readonly string $shopDomain) { - $this->redisKey = "shopify_graphql_rate_limit_{$this->shopDomain}"; + $shopDomainKey = Str::replace(['.'], '_', $this->shopDomain); + $this->redisKey = "shopify_graphql_rate_limit:{$shopDomainKey}"; } public function getRateLimitInfo(): array