Skip to content

Commit

Permalink
Fixing merge - removing double/nested hasViolations() check
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Feb 28, 2024
1 parent ee8823b commit 4aeec06
Showing 1 changed file with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,29 +197,26 @@ protected ServletApiRequest newServletApiRequest()
if (getHttpURI().hasViolations() && !getServletChannel().getServletContextHandler().getServletHandler().isDecodeAmbiguousURIs())
{
// TODO we should check if current compliance mode allows all the violations?
if (getHttpURI().hasViolations())
StringBuilder msg = null;
for (UriCompliance.Violation violation : getHttpURI().getViolations())
{
StringBuilder msg = null;
for (UriCompliance.Violation violation : getHttpURI().getViolations())
if (UriCompliance.AMBIGUOUS_VIOLATIONS.contains(violation))
{
if (UriCompliance.AMBIGUOUS_VIOLATIONS.contains(violation))
if (msg == null)
{
if (msg == null)
{
msg = new StringBuilder();
msg.append("Ambiguous URI encoding: ");
}
else
{
msg.append(", ");
}

msg.append(violation.name());
msg = new StringBuilder();
msg.append("Ambiguous URI encoding: ");
}
else
{
msg.append(", ");
}

msg.append(violation.name());
}
if (msg != null)
return new ServletApiRequest.AmbiguousURI(this, msg.toString());
}
if (msg != null)
return new ServletApiRequest.AmbiguousURI(this, msg.toString());
}

return new ServletApiRequest(this);
Expand Down

0 comments on commit 4aeec06

Please sign in to comment.