Ich muss eine Datei mit einem bestimmten Inhaltstyp (application/pkcs7-mime
) für Apple Universal Links senden. Ich verwende die send_file
Funktion von Schienen, und fügen Sie :type
als Parameter, , aber der Typ ist immer text/plain
.Set Content-Type mit send_file
Hier ist mein Controller:
class AppleController < ApplicationController
def download_app_site_association
send_file "#{Rails.root}/public/apple-app-site-association", {:filename => "apple-app-site-association", :type => "application/pkcs7-mime" , :x_sendfile => true}
end
end
Ich habe auch versucht, es wie folgt hinzuzufügen:
send_file "#{Rails.root}/public/apple-app-site-association", :filename => "apple-app-site-association", :type => "application/pkcs7-mime" , :x_sendfile => true
und manuell wie diese Einstellung:
response.headers["Content-type"] = "application/pkcs7-mime"
send_file "#{Rails.root}/public/apple-app-site-association", :filename => "apple-app-site-association", :x_sendfile => true
mir jemand erklären kann, Warum funktioniert das nicht?
Ja, es gibt, aber wie in meiner Frage geschrieben, funktioniert es nicht für mich. – Shrolox
Nein, es ist nicht registriert, aber ich habe das Problem in meinem Code gefunden und werde die Antwort posten. Danke trotzdem für Hilfe – Shrolox