    # File lib/rack/utils.rb, line 395
        def byte_ranges(env, size)
          # See <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35>
          http_range = env['HTTP_RANGE']
          return nil unless http_range && http_range =~ /bytes=([^;]+)/
          ranges = []
          $1.split(/,\s*/).each do |range_spec|
            return nil  unless range_spec =~ /(\d*)-(\d*)/
            r0,r1 = $1, $2
            if r0.empty?
              return nil  if r1.empty?
              # suffix-byte-range-spec, represents trailing suffix of file
              r0 = size - r1.to_i
              r0 = 0  if r0 < 0
              r1 = size - 1
            else
              r0 = r0.to_i
              if r1.empty?
                r1 = size - 1
              else
                r1 = r1.to_i
                return nil  if r1 < r0  # backwards range is syntactically invalid
                r1 = size-1  if r1 >= size
              end
            end
            ranges << (r0..r1)  if r0 <= r1
          end
          ranges
        end