From cf24e7d2d2b9b85ac52c5dd2bbd4f2301ffa3289 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Sat, 25 Jul 2020 13:27:57 +0300
Subject: [PATCH] Fix a configurable update bug

---
 components/common/cpp/src/configuration.cpp | 22 ++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp
index 960443394..3a0fce37e 100644
--- a/components/common/cpp/src/configuration.cpp
+++ b/components/common/cpp/src/configuration.cpp
@@ -385,20 +385,20 @@ bool ftl::config::update(const std::string &puri, const json_t &value) {
 	string tail = "";
 	string head = "";
 	string uri = preprocessURI(puri);
-	size_t last_hash = uri.find_last_of('#');
-	if (last_hash != string::npos) {
+	//size_t last_hash = uri.find_last_of('/');
+	//if (last_hash != string::npos) {
 		size_t last = uri.find_last_of('/');
-		if (last != string::npos && last > last_hash) {
+		//if (last != string::npos && last > last_hash) {
 			tail = uri.substr(last+1);
 			head = uri.substr(0, last);
-		} else {
-			tail = uri.substr(last_hash+1);
-			head = uri.substr(0, last_hash);
-		}
-	} else {
-		LOG(WARNING) << "Expected a # in an update URI: " << uri;
-		return false;
-	}
+		//} else {
+		//	tail = uri.substr(last_hash+1);
+		//	head = uri.substr(0, last_hash);
+		//}
+	//} else {
+	//	LOG(WARNING) << "Expected a # in an update URI: " << uri;
+	//	return false;
+	//}
 
 	Configurable *cfg = find(head);
 
-- 
GitLab