Commit 84652dbd authored by jz143's avatar jz143

ignore HEAD requests for download counts

parent 5f134027
......@@ -117,6 +117,11 @@ class AppFilesController < ApplicationController
def increment_download_count
# ignore HEAD requests
if request.head?
unless request.headers['Range'].nil?
# ignore request if Range header exists and starting range is not 0
range = request.headers['Range'].match(/bytes=(?<begin>\d+)-(?<end>\d*)/)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment