Skip to content

Commit ebdcce9

Browse files
committed
Added trim to endpoint to avoid bugs
1 parent b615a89 commit ebdcce9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
"Setono\\PostNord\\": "src/"
4242
}
4343
},
44+
"autoload-dev": {
45+
"psr-4": {
46+
"Setono\\PostNord\\": "tests/"
47+
}
48+
},
4449
"prefer-stable": true,
4550
"scripts": {
4651
"analyse": "vendor/bin/phpstan analyse -c phpstan.neon -l max src",

src/Client/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private function sendRequest(string $method, string $endpoint, array $params = [
7777
'apikey' => $this->apiKey,
7878
], $params);
7979

80-
$url = $this->baseUrl . '/' . $endpoint . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
80+
$url = $this->baseUrl . '/' . ltrim($endpoint, '/') . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
8181

8282
$request = $this->requestFactory->createRequest($method, $url);
8383

0 commit comments

Comments
 (0)