CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

Bug: route with "/" respond in any method [GET, POST, PUT, etc]

Open nicojmb opened this issue 1 year ago • 0 comments

PHP Version

8.3

CodeIgniter4 Version

4.5.5

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

fpm-fcgi

Database

MariaDB

What happened?

Hi, I've these routes: image

In postman if i execute:

GET --> /api/devices --> Respond OK POST --> /api/devices --> Respond OK DELETE --> /api/devices --> Respond ERROR (it's normal not exists route)

image

but if i execute with and slash "/" at the end, all routes respond as if they were GET.

GET --> /api/devices/ --> Respond OK POST --> /api/devices/ --> Respond OK DELETE --> /api/devices/ --> Respond OK

image

and I can't find where the problem is

Steps to Reproduce

Make a postman call with adding a slash to the end

Expected Output

Same answer whether it has a slash or not

Anything else?

No response

nicojmb avatar Oct 07 '24 17:10 nicojmb