Respect/Rest

how to deal with ip as parameters

Closed this issue · 5 comments

I have a router like this xxx.com/foo/111.111.111.111
and I define the router like this

get('*/**', ClassA)

in ClassA with a function

public function($command, $params)

but I just get params as

array([0]=>111)

debug in the php file

Respect\Routes\AbstractRoute.php line 114

I know ... it filter out .xxxx with regex

  • so is this a bug?
  • how can i fix it?

i just wrap the ip address with "{}" and replace it off in my code , it is seak

I believe it's a bug. The code for removing file extensions from the route match seems to be interfering with the parameters =( I'll get some time this week to solve this.

This behavior should only be triggered when you use something like Content Negotiation (with the ->accept()) routine, are you using those?

doesn't only be triggered when I use accept()....

I meet it just in the routing match.... uri with dot tail was cut off

I have used it like this with domain names which is similar.

I actually added the scheme too

the route

/explore/*/*/*/*/**

Which happily serves urls like

/explore/application/json/http/github.com/api/....
/explore/text/html/https/www.secure-api.com/v1/....

And all the sub urls are covered.
I do, mind you use Accept Routine with extension support to enable .json/.xml/.etc for browsers which don't want to change their accept. The way to ignore the extensions is by implementing or using something that implements

IgnorableFileExtension

So add it to your controller for example and give it another shot. Let us know...

@hellovigoss did you come right? Need a hand with anything? Let us know what you got up to =)

Closing issue no further discussions in 2 months. @hellovigoss feel free to reopen should you require further assistance.