From 54d5aba2180e039245ca3f979107ceaefc544e6c Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Thu, 30 Sep 2021 20:10:23 -0700 Subject: [PATCH] Fixing IPRange validation for PUT on entities. --- build | 2 +- src/RESTAPI_entity_handler.cpp | 2 +- test_scripts/curl/config_uuid_only.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build b/build index d3b9819..030d25b 100644 --- a/build +++ b/build @@ -1 +1 @@ -246 \ No newline at end of file +248 \ No newline at end of file diff --git a/src/RESTAPI_entity_handler.cpp b/src/RESTAPI_entity_handler.cpp index 0ed60f2..6e7fc04 100644 --- a/src/RESTAPI_entity_handler.cpp +++ b/src/RESTAPI_entity_handler.cpp @@ -181,7 +181,7 @@ namespace OpenWifi{ } if(RawObject->has("sourceIP")) { - if(!NewEntity.sourceIP.empty() && CIDR::ValidateIpRanges(NewEntity.sourceIP)) { + if(!NewEntity.sourceIP.empty() && !CIDR::ValidateIpRanges(NewEntity.sourceIP)) { BadRequest(RESTAPI::Errors::InvalidIPRanges); return; } diff --git a/test_scripts/curl/config_uuid_only.json b/test_scripts/curl/config_uuid_only.json index 7dda00d..65eda30 100644 --- a/test_scripts/curl/config_uuid_only.json +++ b/test_scripts/curl/config_uuid_only.json @@ -1,4 +1,4 @@ { "configuration" : - { "uuid": "1" } + { "uuid": 1 } }