Skip to content

Fix get/mget prefix search bug#8

Merged
jehiah merged 2 commits into
jehiah:masterfrom
seomoz:evan/fix_get_no_prefix_search
Aug 5, 2016
Merged

Fix get/mget prefix search bug#8
jehiah merged 2 commits into
jehiah:masterfrom
seomoz:evan/fix_get_no_prefix_search

Conversation

@evanbattaglia

Copy link
Copy Markdown

Seems to fix #7

This is my first time writing any Go.

@evanbattaglia

Copy link
Copy Markdown
Author

Ah, just realized this could be a problem if len(line) == len(needle). I will change len(line) >= len(needle) to len(line) > len(needle), because in my use case I only use lines with a value as well as a key.

@evanbattaglia

Copy link
Copy Markdown
Author

Fixed. FWIW, the current master also crashes in this case a line with no value. e.g.

echo helloworld > test.tsv
sortdb -db-file=test.tsv &
curl localhost:8080/get?key=helloworld

@jehiah
jehiah merged commit 8706c31 into jehiah:master Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/get and /mget perform (buggy) prefix searches

2 participants