Skip to content

Commit

Permalink
Limit sse split to 2 elements. (#24)
Browse files Browse the repository at this point in the history
Default fetch query param 'q' to ''.
  • Loading branch information
Matt Duftler committed May 18, 2017
1 parent d19884a commit 8094fb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<AtlasResults> fromBody(TypedInput body, Type type) throws Conversion
reader
.lines()
.filter(line -> !StringUtils.isEmpty(line))
.map(line -> line.split(": "))
.map(line -> line.split(": ", 2))
.collect(Collectors.toList());

tokenizedLines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private AtlasResults generateDummyContent(String q, String s, String e, String s
}

@RequestMapping(method = RequestMethod.GET, produces = "text/event-stream")
public String queryMetrics(@RequestParam final String q,
public String queryMetrics(@RequestParam(defaultValue = "") final String q,
@RequestParam(defaultValue = "0") final String s,
@RequestParam(defaultValue = "6000000") final String e,
@RequestParam(defaultValue = "PT1M") final String step) throws IOException {
Expand Down

0 comments on commit 8094fb1

Please sign in to comment.