Search in sources :

Example 1 with AcceptType

use of org.webpieces.httpparser.api.subparsers.AcceptType in project webpieces by deanhiller.

the class HeaderPriorityParserImpl method parseAcceptFromRequest.

@Override
public List<AcceptType> parseAcceptFromRequest(HttpRequest req) {
    List<AcceptType> list = new ArrayList<>();
    Header header = req.getHeaderLookupStruct().getHeader(KnownHeaderName.ACCEPT);
    if (header == null)
        return list;
    String value = header.getValue();
    return parsePriorityItems(value, s -> parseAcceptSubitem(s));
}
Also used : Header(org.webpieces.httpparser.api.common.Header) ArrayList(java.util.ArrayList) AcceptType(org.webpieces.httpparser.api.subparsers.AcceptType)

Aggregations

ArrayList (java.util.ArrayList)1 Header (org.webpieces.httpparser.api.common.Header)1 AcceptType (org.webpieces.httpparser.api.subparsers.AcceptType)1