Commit 4fa04de6 authored by jz143's avatar jz143

fixes download counts; fixes signing process

parent f6d4271b
......@@ -26,3 +26,4 @@ unix:///home/appstore/appstore/shared/tmp/sockets/puma.sock
* API for app authors to get latest version info from Duke App Store and prompt users to update their apps
* Better app ordering, categories, etc.
* Sidebar on app download page to showcase related apps, as well as more info about us
* Support for Android apps
\ No newline at end of file
......@@ -114,10 +114,12 @@ class AppFilesController < ApplicationController
private
def increment_download_count
# ignore request if Range header exists and starting range is not 0
range = request.headers['Range'].match(/bytes=(?<begin>\d+)-(?<end>\d*)/)
if range[:begin] != '0'
return
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*)/)
if range[:begin] != '0'
return
end
end
@app_file.increment!(:download_count)
......
......@@ -24,7 +24,7 @@ class FetchedSignedIpaJob < ActiveJob::Base
# remove user uploaded unsigned package to save space
log << "removing local, unsigned copy\n"
app_file.archive.destroy
FileUtils.remove_file(app_file.archive.path, true)
app_file.signed!
rescue => e
......
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