=htp Extract RemoteAddress.Unknown when cannot find client ip (#21289)
* handle unknown client ip * updated doc * fixed java dsl test
This commit is contained in:
parent
3e86c2a44f
commit
0e302d2236
4 changed files with 9 additions and 3 deletions
|
|
@ -72,7 +72,7 @@ public class MiscDirectivesTest extends JUnitRouteTest {
|
|||
|
||||
route
|
||||
.run(HttpRequest.create())
|
||||
.assertStatusCode(StatusCodes.NOT_FOUND);
|
||||
.assertStatusCode(StatusCodes.OK);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ class MiscDirectivesSpec extends RoutingSpec {
|
|||
extractClientIP { echoComplete }
|
||||
} ~> check { responseAs[String] shouldEqual "1.2.3.4" }
|
||||
}
|
||||
"extract unknown when no headers" in {
|
||||
Get() ~> {
|
||||
extractClientIP { echoComplete }
|
||||
} ~> check { responseAs[String] shouldEqual "unknown" }
|
||||
}
|
||||
}
|
||||
|
||||
"the selectPreferredLanguage directive" should {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue