Skip to content

Commit

Permalink
Merge pull request #28 from pansershrek/fix/graphite_default_location
Browse files Browse the repository at this point in the history
Add feature: if location name renders empty, set it to "_"
  • Loading branch information
kirimedia authored Aug 14, 2019
2 parents 212712d + 5d0c130 commit 3cfc58f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ngx_http_graphite_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ ngx_http_graphite_location(ngx_pool_t *pool, const ngx_str_t *uri) {
while (split->len > 0 && split->data[split->len - 1] == '_')
split->len--;

if (split->len == 0) {
split->data[split->len++] = '_';
}

return split;
}

Expand Down

0 comments on commit 3cfc58f

Please sign in to comment.