=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:
dyk 2016-08-26 16:47:36 +02:00 committed by Konrad Malawski
parent 3e86c2a44f
commit 0e302d2236
4 changed files with 9 additions and 3 deletions

View file

@ -72,7 +72,7 @@ public class MiscDirectivesTest extends JUnitRouteTest {
route
.run(HttpRequest.create())
.assertStatusCode(StatusCodes.NOT_FOUND);
.assertStatusCode(StatusCodes.OK);
}
@Test

View file

@ -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 {