Fixed NPE in case of a missing Max-Forwards header

This commit is contained in:
Oleg Kalnichevski 2017-10-15 13:31:13 +02:00
parent 0c862432d8
commit 30320fe2f4

View File

@ -354,7 +354,8 @@ boolean clientRequestsOurOptions(final HttpRequest request) {
return false;
}
if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue())) {
final Header h = request.getFirstHeader(HeaderConstants.MAX_FORWARDS);
if (!"0".equals(h != null ? h.getValue() : null)) {
return false;
}