Skip to content

Bug: $this->request->getUri()->getPath() is not compatible with PSR-7 #7123

@kenjis

Description

@kenjis

CodeIgniter4 Version: v4.3.1

$this->request->getUri()->getPath() returns the route (URI path relative to baseURL).

app.baseURL = 'http://localhost:8888/ci431/public/'

When navigating to http://localhost:8888/ci431/public/test?a=b,

$uri = $this->request->getUri();
echo (string) $uri;   // "http://localhost:8888/ci431/public/test?a=b" → Okay
echo $uri->getPath(); // "test" → NG. It should be "/ci431/public/test" when following PSR-7

Ref https://www.php-fig.org/psr/psr-7/

Related #5930

Metadata

Metadata

Assignees

Labels

bugVerified issues on the current code behavior or pull requests that will fix them

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions