rdkcentral / Lightning-SDK

SDK for Lightning framework
Apache License 2.0
130 stars 69 forks source link

Router: Allow periods in hash values #263

Closed frank-weindel closed 3 years ago

frank-weindel commented 3 years ago

Given the route defintion:

/route/:param

And given the hash:

/route/this.is.my.value

Currently Lightning SDK router does not return the entire expected value for :param and instead only returns the value as 'this'.

This PR allows periods to be in a hash value.

QUESTION: Is there a reason this is so restrictive? Could we perhaps change the regex to something much less restrictive like?:

/(\/?:?[^/]+)/g
erikhaandrikman commented 3 years ago

There is no real reasoning behing only allowing @!*\w%\s:- it just grew towards this set over time. It's even missing other accepted (unreserved characters) https://datatracker.ietf.org/doc/html/rfc3986#section-2.3

We will put the investigation of allowing all accept forward slash [^/] on our backlog

frank-weindel commented 3 years ago

@erikhaandrikman thanks! looks like some other commits got merged into dev from master. My bad for not basing it from dev to begin with.