[Zrouter-src] ZRouter.org: push to zconf++ zconf++/http_json_handler.cc
zrouter-src at zrouter.org
zrouter-src at zrouter.org
Mon Jan 23 17:24:01 UTC 2012
details: /rev/2d8b7bc940de
changeset: 48:2d8b7bc940de
user: "Nicolai Petri <nicolai at petri.dk>"
date: Mon Jan 23 18:21:28 2012 +0100
description:
Return 404 when asking for non-existing parts of tree.
Before we poluted the tree with "null" objects for non-existing paths.
diffstat:
zconf++/http_json_handler.cc | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diffs (14 lines):
diff -r 56b8890d8ce3 -r 2d8b7bc940de zconf++/http_json_handler.cc
--- a/zconf++/http_json_handler.cc Mon Jan 23 18:20:33 2012 +0100
+++ b/zconf++/http_json_handler.cc Mon Jan 23 18:21:28 2012 +0100
@@ -69,6 +69,10 @@
for (; it != uri_parts.end(); it++) {
if (*it == "")
continue;
+ if (!leaf->contains(*it)) {
+ rep = reply::stock_reply(reply::not_found);
+ return;
+ }
leaf = &((*leaf)[*it]);
cout << "REQ PART: " << *it << endl;
}
More information about the Zrouter-src
mailing list