Skip to content

Commit

Permalink
Issue #8578 - test both request URL/URI results
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Sep 9, 2022
1 parent d3c7ee3 commit 48c16de
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -876,10 +876,12 @@ public boolean check(HttpServletRequest request, HttpServletResponse response)
@Test
public void testConnectRequestURL() throws Exception
{
final AtomicReference<String> result = new AtomicReference<>();
final AtomicReference<String> resultRequestURL = new AtomicReference<>();
final AtomicReference<String> resultRequestURI = new AtomicReference<>();
_handler._checker = (request, response) ->
{
result.set("" + request.getRequestURL());
resultRequestURL.set("" + request.getRequestURL());
resultRequestURI.set("" + request.getRequestURI());
return true;
};

Expand All @@ -890,7 +892,8 @@ public void testConnectRequestURL() throws Exception
"\n");
HttpTester.Response response = HttpTester.parseResponse(rawResponse);
assertThat(response.getStatus(), is(HttpStatus.OK_200));
assertThat(result.get(), is("http://myhost:9999"));
assertThat(resultRequestURL.get(), is("http://myhost:9999"));
assertThat(resultRequestURI.get(), is("myhost:9999"));
}

@Test
Expand Down

0 comments on commit 48c16de

Please sign in to comment.