app/controllers/passkit/api/v1/passes_controller.rb in passkit-0.5.2 vs app/controllers/passkit/api/v1/passes_controller.rb in passkit-0.5.3
- old
+ new
@@ -3,11 +3,11 @@
module V1
class PassesController < ActionController::API
before_action :decrypt_payload, only: :create
def create
- send_file(fetch_pass(@payload))
+ send_file(fetch_pass(@payload), type: 'application/vnd.apple.pkpass', disposition: 'attachment')
end
# @return If request is authorized, returns HTTP status 200 with a payload of the pass data.
# @return If the request is not authorized, returns HTTP status 401.
# @return Otherwise, returns the appropriate standard HTTP status.
@@ -27,10 +27,10 @@
pass_output_path = Passkit::Generator.new(pass).generate_and_sign
response.headers["last-modified"] = pass.last_update.strftime("%Y-%m-%d %H:%M:%S")
if request.headers["If-Modified-Since"].nil? ||
(pass.last_update.to_i > Time.zone.parse(request.headers["If-Modified-Since"]).to_i)
- send_file(pass_output_path)
+ send_file(pass_output_path, type: 'application/vnd.apple.pkpass', disposition: 'attachment')
else
head :not_modified
end
end