Merge default
This commit is contained in:
commit
480d681eac
|
|
@ -161,7 +161,7 @@ dispatcher_add(function(sammy) {
|
|||
'policy', '#/policies');
|
||||
});
|
||||
sammy.put('#/policies', function() {
|
||||
put_parameter(this, ['key', 'pattern', 'policy'], ['priority']);
|
||||
put_parameter(this, ['key', 'pattern', 'policy'], ['priority'], []);
|
||||
return false;
|
||||
});
|
||||
sammy.del('#/policies', function() {
|
||||
|
|
|
|||
|
|
@ -778,7 +778,7 @@ function maybe_remove_fields(params) {
|
|||
return params;
|
||||
}
|
||||
|
||||
function put_parameter(sammy, mandatory_keys, num_keys) {
|
||||
function put_parameter(sammy, mandatory_keys, num_keys, bool_keys) {
|
||||
for (var i in sammy.params) {
|
||||
if (i === 'length' || !sammy.params.hasOwnProperty(i)) continue;
|
||||
if (sammy.params[i] == '' && mandatory_keys.indexOf(i) == -1) {
|
||||
|
|
@ -787,6 +787,9 @@ function put_parameter(sammy, mandatory_keys, num_keys) {
|
|||
else if (num_keys.indexOf(i) != -1) {
|
||||
sammy.params[i] = parseInt(sammy.params[i]);
|
||||
}
|
||||
else if (bool_keys.indexOf(i) != -1) {
|
||||
sammy.params[i] = sammy.params[i] == 'true';
|
||||
}
|
||||
}
|
||||
var params = {"component": sammy.params.component,
|
||||
"vhost": sammy.params.vhost,
|
||||
|
|
|
|||
Loading…
Reference in New Issue