Skip to content

Commit

Permalink
DO NOTHING if ignoreNullRequest is true
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Oct 12, 2020
1 parent 8d36e1e commit 1b81017
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class HttpQuery extends Log implements AbortParticipant, Configurable, De
private String contentTypeName;
private String basicAuthenticationName;
private RedirectStrategy redirectStrategy;
private boolean ignoreNullRequest;

// A shared client for the instance.
// Created at configuration time; destroyed when this participant is destroyed.
Expand All @@ -95,7 +96,7 @@ public int prepare (long id, Serializable o) {

HttpRequestBase httpRequest = getHttpRequest(ctx);
if (httpRequest == null)
return FAIL; // probably wrong http method; abort early and avoid NPEs later
return ignoreNullRequest ? PREPARED | NO_JOIN | READONLY : FAIL;

addHeaders(ctx, httpRequest);

Expand Down Expand Up @@ -191,6 +192,7 @@ public void setConfiguration (Configuration cfg) throws ConfigurationException {
contentTypeName = cfg.get("contentTypeName", "HTTP_CONTENT_TYPE");
responseName = cfg.get("responseName", "HTTP_RESPONSE");
statusName = cfg.get("responseStatusName", "HTTP_STATUS");
ignoreNullRequest = cfg.getBoolean("ignoreNullRequest", false);

preemptiveAuth = cfg.getBoolean("preemptiveAuth", preemptiveAuth);
basicAuthenticationName = cfg.get("basicAuthenticationName", ".HTTP_BASIC_AUTHENTICATION");
Expand Down

0 comments on commit 1b81017

Please sign in to comment.