From b5f713a888d1fc90c3c3664a5197a4cfcb969750 Mon Sep 17 00:00:00 2001 From: Ebus-at-dockstar Date: Sun, 27 Jul 2014 17:07:25 +0200 Subject: allow underscore in value name --- datastore-leveldb/src/web.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'datastore-leveldb/src/web.cpp') 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(×tamp, 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()); -- cgit v1.2.1