Skip to content

Commit

Permalink
doubled back slashs on escaping back slashs
Browse files Browse the repository at this point in the history
  • Loading branch information
cafe24-jspark03 committed Nov 4, 2019
1 parent 6020fc9 commit 37b7ce9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'com.joonsang.graylog'
version = '1.0.0'
version = '1.0.1'

sourceCompatibility = 11

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/joonsang/graylog/GraylogQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ private String sanitize(String value) {
*/
private String escape(String input) {
final String[] metaCharacters = {
"&", "|", ":", "\\", "/", "+", "-", "!", "(", ")", "{", "}", "[", "]", "^", "\"", "~", "*", "?"
"\\", "&", "|", ":", "/", "+", "-", "!", "(", ")", "{", "}", "[", "]", "^", "\"", "~", "*", "?"
};

for (String meta: metaCharacters) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/joonsang/graylog/GraylogQueryTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void TC_020_ESCAPING() {
.and()
.field("response_body", "{\"nickname\": \"[*test] John Doe\", \"message\": \"hello?\"}");

String expect = "content_type:\"application\\/json\" AND response_body:\"\\{\\\"nickname\\\"\\\\: \\\"\\[\\*test\\] John Doe\\\", \\\"message\\\"\\\\: \\\"hello\\?\\\"\\}\"";
String expect = "content_type:\"application\\/json\" AND response_body:\"\\{\\\"nickname\\\"\\: \\\"\\[\\*test\\] John Doe\\\", \\\"message\\\"\\: \\\"hello\\?\\\"\\}\"";

assertThat(query.build())
.as("TC_020_SANITIZE")
Expand Down

0 comments on commit 37b7ce9

Please sign in to comment.