Closed DSpeichert closed 8 years ago
I am executing the following call in order to add a firewall rule on the IP:
await ovh.requestPromised('POST', '/ip/' + encodeURIComponent(ipblock) + '/firewall/' + ip + '/rule', ruleObj);
Consider the following ruleObj:
ruleObj
ruleObj = { action: 'permit', destinationPort: null, protocol: 'udp', sequence: 0, source: '8.8.8.8/32', sourcePort: 53, tcpOption: null };
This will fail with error: error=400, message=Missing sequence parameter while calling creation handler
error=400, message=Missing sequence parameter while calling creation handler
However, when I use the following, it works!:
ruleObj = { action: 'permit', destinationPort: null, protocol: 'udp', sequence: new String(0), source: '8.8.8.8/32', sourcePort: 53, tcpOption: null };
It seems like the ovh library is treating numeric 0 as null and not sending it, while a String of 0 is properly sent. Other numbers work as expected when sent as Numbers.
ovh
0
String
Thanks for your report ! I'll check that next week ! And keep you update
It's done in v2.0.1. Let me know if it's right for you too ! Thank you
I am executing the following call in order to add a firewall rule on the IP:
Consider the following
ruleObj
:This will fail with error:
error=400, message=Missing sequence parameter while calling creation handler
However, when I use the following, it works!:
It seems like the
ovh
library is treating numeric0
as null and not sending it, while aString
of 0 is properly sent. Other numbers work as expected when sent as Numbers.