def parse_content_range_header(value, on_update=None):
    if value is None:
        return None
    try:
        units, rangedef = (value or '').strip().split(None, 1)
    except ValueError:
        return None

    if '/' not in rangedef:
        return None
    rng, length = rangedef.split('/', 1)
    if length == '*':
        length = None
    elif length.isdigit():
        length = int(length)
    else:
        return None

    if rng == '*':
        return ContentRange(units, None, None, length, on_update=on_update)
    elif '-' not in rng:
        return None

    start, stop = rng.split('-', 1)
    try:
        start = int(start)
        stop = int(stop) + 1
    except ValueError:
        return None

    if is_byte_range_valid(start, stop, length):
        return ContentRange(units, start, stop, length, on_update=on_update)
If an exception is thrown, deal with it and present an error page.
dataset/ETHPy150Open Eforcers/gae-flask-todo/lib/werkzeug/http.py/parse_content_range_header--crossover with--dataset/ETHPy150Open toastdriven/itty/itty.py/handle_error