forked from statsd/statsd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/helpers: fixed is_valid_packet()
This commit introduces following changes: * Be liberal in what you recieve - do not rely on regexps for packet parsing but instead accept anything that can be parsed by JavaScript as a number e.g: +1e-17, -0511, 0xDEADbeef, etc * Accept both positive and negative counters with explicit / implicit sign * Provides more strict error checking then regexp, for example following strings match previously used '([\-\+\d\.]+' regexp: . .123. .\-+\0\+-.1- Also while here added more tests. Closes: statsd#350 statsd#357 Signed-off-by: Alexey Ivanov <SaveTheRbtz@GMail.com>
- Loading branch information
Alexey Ivanov
committed
Dec 31, 2013
1 parent
bad366c
commit 63fb16c
Showing
2 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters