Skip to content

Commit

Permalink
fix(server): add tip for gremlin api NPE with empty query (#2467)
Browse files Browse the repository at this point in the history
fix #2426
  • Loading branch information
SunnyBoy-WYH authored Mar 1, 2024
1 parent 2e3adcd commit 3f127f0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.hugegraph.api.filter.CompressInterceptor.Compress;
import org.apache.hugegraph.config.HugeConfig;
import org.apache.hugegraph.metrics.MetricsUtil;
import org.apache.hugegraph.util.E;

import com.codahale.metrics.Histogram;
import com.codahale.metrics.annotation.Timed;
Expand Down Expand Up @@ -77,6 +78,7 @@ public Response get(@Context HugeConfig conf,
@Context UriInfo uriInfo) {
String auth = headers.getHeaderString(HttpHeaders.AUTHORIZATION);
String query = uriInfo.getRequestUri().getRawQuery();
E.checkArgumentNotNull(query, "The request query can't be empty");
MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
Response response = this.client().doGetRequest(auth, params);
GREMLIN_INPUT_HISTOGRAM.update(query.length());
Expand Down

0 comments on commit 3f127f0

Please sign in to comment.