Skip to content

Commit

Permalink
Fix Router handling of SQL queries. (apache#4851)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianm committed Nov 14, 2017
1 parent 3c76bca commit 3291e04
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
request.setAttribute(HOST_ATTRIBUTE, defaultServer.getHost());
request.setAttribute(SCHEME_ATTRIBUTE, defaultServer.getScheme());

final boolean isQueryEndpoint = request.getRequestURI().startsWith("/druid/v2");
// The Router does not have the ability to look inside SQL queries and route them intelligently, so just treat
// them as a generic request.
final boolean isQueryEndpoint = request.getRequestURI().startsWith("/druid/v2")
&& !request.getRequestURI().startsWith("/druid/v2/sql");

if (isQueryEndpoint && HttpMethod.DELETE.is(request.getMethod())) {
// query cancellation request
Expand Down

0 comments on commit 3291e04

Please sign in to comment.