Skip to content

Commit

Permalink
Change error wording from Duplicate to Multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
jfernandez committed May 26, 2021
1 parent c1b0b5f commit 72bce0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ private void channelReadInternal(final ChannelHandlerContext ctx, Object msg) th
zuulRequest.getContext().setShouldSendErrorResponse(true);
} else if (zuulRequest.getHeaders().getAll(HttpHeaderNames.HOST.toString()).size() > 1) {
LOG.debug(
"Duplicate Host headers. clientRequest = {} , uri = {}, info = {}",
"Multiple Host headers. clientRequest = {} , uri = {}, info = {}",
clientRequest,
clientRequest.uri(),
ChannelUtils.channelInfoForLogging(ctx.channel()));
final ZuulException ze = new ZuulException("Duplicate Host headers");
final ZuulException ze = new ZuulException("Multiple Host headers");
ze.setStatusCode(HttpResponseStatus.BAD_REQUEST.code());
StatusCategoryUtils.setStatusCategory(
zuulRequest.getContext(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void maxHeaderSizeExceeded_setBadRequestStatus() {
}

@Test
public void duplicateHostHeader_setBadRequestStatus() {
public void multipleHostHeaders_setBadRequestStatus() {
ClientRequestReceiver receiver = new ClientRequestReceiver(null);
EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestEncoder());
PassportLoggingHandler loggingHandler = new PassportLoggingHandler(new DefaultRegistry());
Expand All @@ -226,7 +226,7 @@ public void duplicateHostHeader_setBadRequestStatus() {
SessionContext context = request.getContext();
assertEquals(StatusCategoryUtils.getStatusCategory(context),
ZuulStatusCategory.FAILURE_CLIENT_BAD_REQUEST);
assertEquals("Duplicate Host headers", context.getError().getMessage());
assertEquals("Multiple Host headers", context.getError().getMessage());
}

@Test
Expand Down

0 comments on commit 72bce0d

Please sign in to comment.