@Override
    public void process(final HttpRequest request, final EntityDetails entity, final HttpContext context)
            throws HttpException, IOException {
        Args.notNull(request, "HTTP request");

        final Header ifRangeHeader = request.getFirstHeader(HttpHeaders.IF_RANGE);

        // If there's no If-Range header, just return
        if (ifRangeHeader == null) {
            return;
        }

        // If there's an If-Range header but no Range header, throw an exception
        if (!request.containsHeader(HttpHeaders.RANGE)) {
            throw new ProtocolException("Request with 'If-Range' header must also contain a 'Range' header.");
        }

        final ETag eTag = ETag.get(request);

        // If there's a weak ETag in the If-Range header, throw an exception
        if (eTag != null && eTag.getType() == ValidatorType.WEAK) {
            throw new ProtocolException("'If-Range' header must not contain a weak entity tag.");
        }

        final Instant dateInstant = DateUtils.parseStandardDate(request, HttpHeaders.DATE);

        if (dateInstant == null) {
            return;
        }

        final Instant lastModifiedInstant = DateUtils.parseStandardDate(request, HttpHeaders.LAST_MODIFIED);

        if (lastModifiedInstant == null) {
            // If there's no Last-Modified header, we exit early because we can't deduce that it is strong.
            return;
        }

        // If the difference between the Last-Modified and Date headers is less than 1 second, throw an exception
        if (lastModifiedInstant.plusSeconds(1).isAfter(dateInstant) && eTag != null) {
            throw new ProtocolException("'If-Range' header with a Date must be a strong validator.");
        }
    }
Processes the given request to ensure it adheres to the RFC guidelines for the 'If-Range' header.

@param request The HTTP request to be processed.
@param entity  The entity details of the request.
@param context The HTTP context.
@throws HttpException If the request does not adhere to the RFC guidelines.
@throws IOException   If an I/O error occurs.
httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestIfRange.java