Trailing forward slash gets lost in your implementation while it's preserved in other libraries (for example httpsoft/http-message)
$request = new Request('GET', 'https://example.com/test/');
echo (string) $request->getUri(); // "https://example.com/test"
expected result:
$request = new Request('GET', 'https://example.com/test/');
echo (string) $request->getUri(); // "https://example.com/test/"
UPDATE: Looks like the behavior is intentional:
|
if( empty($this->path) && $this->getAuthority() ){ |
|
$url .= "/"; |
|
} |
|
elseif( $this->path ) { |
|
$url .= ("/" . \trim($this->path, "/")); |
|
} |
Trailing forward slash gets lost in your implementation while it's preserved in other libraries (for example httpsoft/http-message)
expected result:
UPDATE: Looks like the behavior is intentional:
Capsule/src/Uri.php
Lines 238 to 243 in 0aa1c83