Example usage for org.apache.http.client.cache HeaderConstants MAX_FORWARDS

List of usage examples for org.apache.http.client.cache HeaderConstants MAX_FORWARDS

Introduction

In this page you can find the example usage for org.apache.http.client.cache HeaderConstants MAX_FORWARDS.

Prototype

String MAX_FORWARDS

To view the source code for org.apache.http.client.cache HeaderConstants MAX_FORWARDS.

Click Source Link

Usage

From source file:org.apache.http.impl.client.cache.CachingExec.java

boolean clientRequestsOurOptions(final HttpRequest request) {
    final RequestLine line = request.getRequestLine();

    if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
        return false;
    }//from w w  w.ja  v a2s.  c  om

    if (!"*".equals(line.getUri())) {
        return false;
    }

    if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue())) {
        return false;
    }

    return true;
}

From source file:org.apache.http.impl.client.cache.CachingHttpAsyncClient.java

boolean clientRequestsOurOptions(final HttpRequest request) {
    final RequestLine line = request.getRequestLine();

    if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
        return false;
    }/*from  w w  w  . jav  a 2  s  .  c om*/

    if (!"*".equals(line.getUri())) {
        return false;
    }
    return "0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue());
}

From source file:org.apache.http.impl.client.cache.CachingHttpClient.java

boolean clientRequestsOurOptions(HttpRequest request) {
    RequestLine line = request.getRequestLine();

    if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod()))
        return false;

    if (!"*".equals(line.getUri()))
        return false;

    if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
        return false;

    return true;//from w  w  w. j  a  v  a  2 s . c o m
}