mgmt: respond with 414 if StrategyChoice prefix is too long
refs #4262
Change-Id: Ief6dec02d7fbf372382a167e04d82e48777fa30b
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index 9732bd2..6cb5d57 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -57,7 +57,7 @@
StrategyChoice::InsertResult res = m_table.insert(prefix, strategy);
if (!res) {
NFD_LOG_DEBUG("strategy-choice/set(" << prefix << "," << strategy << "): cannot-create " << res);
- return done(ControlResponse(404, boost::lexical_cast<std::string>(res)));
+ return done(ControlResponse(res.getStatusCode(), boost::lexical_cast<std::string>(res)));
}
NFD_LOG_DEBUG("strategy-choice/set(" << prefix << "," << strategy << "): OK");