summaryrefslogtreecommitdiff
path: root/datastore-leveldb/src/web.cpp
diff options
context:
space:
mode:
authorEbus-at-dockstar <ebus@dockstar>2014-07-27 17:07:25 +0200
committerEbus-at-dockstar <ebus@dockstar>2014-07-27 17:11:51 +0200
commitb5f713a888d1fc90c3c3664a5197a4cfcb969750 (patch)
tree87c8683f809b45416bced734560a58b807ad12a5 /datastore-leveldb/src/web.cpp
parent3cd78de16f985af16438d04cefedd28019257824 (diff)
downloadebus-alt-b5f713a888d1fc90c3c3664a5197a4cfcb969750.tar.gz
ebus-alt-b5f713a888d1fc90c3c3664a5197a4cfcb969750.zip
allow underscore in value name
Diffstat (limited to 'datastore-leveldb/src/web.cpp')
-rw-r--r--datastore-leveldb/src/web.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/datastore-leveldb/src/web.cpp b/datastore-leveldb/src/web.cpp
index 443e782..503e3aa 100644
--- a/datastore-leveldb/src/web.cpp
+++ b/datastore-leveldb/src/web.cpp
@@ -37,7 +37,7 @@ static inline bool parse_key(leveldb::Slice &&key, uint64_t *value) {
}
const boost::regex web_handle_api_value_R(
- "/api/value/([a-zA-Z0-9\\.]+)");
+ "/api/value/([a-zA-Z0-9_\\.]+)");
void web_handle_api_value(const boost::cmatch &match, struct mg_connection *conn) {
std::string sensor(match[1].str());
uint64_t timestamp = now();
@@ -53,7 +53,7 @@ void web_handle_api_value(const boost::cmatch &match, struct mg_connection *conn
}
const boost::regex web_handle_api_value_timestamp_R(
- "/api/value/([a-zA-Z0-9\\.]+)/([0-9]+)");
+ "/api/value/([a-zA-Z0-9_\\.]+)/([0-9]+)");
void web_handle_api_value_timestamp(const boost::cmatch &match, struct mg_connection *conn) {
std::string sensor(match[1].str());
uint64_t timestamp; strToL(&timestamp, match[2].str());
@@ -95,7 +95,7 @@ static inline void print_json_tuple(struct mg_connection *conn,
const boost::regex web_handle_api_range_R(
- "/api/range/([a-zA-Z0-9\\.]+)/([0-9]+)/([0-9]+)");
+ "/api/range/([a-zA-Z0-9_\\.]+)/([0-9]+)/([0-9]+)");
void web_handle_api_range(const boost::cmatch &match, struct mg_connection *conn) {
std::string sensor(match[1].str());
uint64_t start; strToL(&start, match[2].str());
@@ -133,7 +133,7 @@ void web_handle_api_range(const boost::cmatch &match, struct mg_connection *conn
}
const boost::regex web_handle_api_range_size_R(
- "/api/range/([a-zA-Z0-9\\.]+)/([0-9]+)/([0-9]+)/([0-9]+)");
+ "/api/range/([a-zA-Z0-9_\\.]+)/([0-9]+)/([0-9]+)/([0-9]+)");
void web_handle_api_range_size(const boost::cmatch &match, struct mg_connection *conn) {
std::string sensor(match[1].str());
uint64_t start; strToL(&start, match[2].str());