aREST
aREST copied to clipboard
Bug with Variable and Function Names
If you create a function say fan and also create a variable called fanstate then whenever a client rest request is made to read value of fanstate, process() routine will find it but later on in processing of the request it also find partial match of function name and things client is trying to invoke function resulting in an error. Using answer.startsWith() in process state machine is not going to work in this case or the state machine itself will need to be tightened up to handle this situation.
Example that causes problem: rest.variable("fanstate", &fanstate); rest.function("fan", fanControl);
Indeed, that's a bug, well catched :)
I was pulling my hair out LOL!
Dave
On Fri, Jun 2, 2017 at 1:28 PM, marcoschwartz [email protected] wrote:
Indeed, that's a bug, well catched :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marcoschwartz/aREST/issues/153#issuecomment-305858341, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFni6yfsWEmmBZfJzysU6wGdmytM7rJks5sAEYmgaJpZM4Nqv5Q .
Noticed something else:
example:
http://192.168.1.25/controlfan?param=ON
When I am evaluating in code for param the first character is stripped so I only see 'N'
I have to do this
http://192.168.1.25/controlfan?param=_ON
I think I can probably use any character for the first one but is that the correct behavior?
Dave
On Fri, Jun 2, 2017 at 1:51 PM, David Gunnell [email protected] wrote:
I was pulling my hair out LOL!
Dave
On Fri, Jun 2, 2017 at 1:28 PM, marcoschwartz [email protected] wrote:
Indeed, that's a bug, well catched :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marcoschwartz/aREST/issues/153#issuecomment-305858341, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFni6yfsWEmmBZfJzysU6wGdmytM7rJks5sAEYmgaJpZM4Nqv5Q .
For the second issue, it's because you need to use params= (with an s) :)
Thanks!
Dave
On Tue, Jun 6, 2017 at 10:58 AM, marcoschwartz [email protected] wrote:
For the second issue, it's because you need to use params= (with an s) :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marcoschwartz/aREST/issues/153#issuecomment-306513173, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFni__oBZPnqbEzjnZjhoDAti6iY2Jgks5sBWkOgaJpZM4Nqv5Q .