mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Support application/gzip theme imports, and improve error message
This commit is contained in:
@ -84,7 +84,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
rescue RemoteTheme::ImportError => e
|
||||
render_json_error e.message
|
||||
end
|
||||
elsif params[:bundle] || params[:theme] && params[:theme].content_type == "application/x-gzip"
|
||||
elsif params[:bundle] || params[:theme] && ["application/x-gzip", "application/gzip"].include?(params[:theme].content_type)
|
||||
# params[:bundle] used by theme CLI. params[:theme] used by admin UI
|
||||
bundle = params[:bundle] || params[:theme]
|
||||
begin
|
||||
@ -95,7 +95,7 @@ class Admin::ThemesController < Admin::AdminController
|
||||
render_json_error e.message
|
||||
end
|
||||
else
|
||||
render_json_error status: :unprocessable_entity
|
||||
render_json_error I18n.t("themes.import_error.unknown_file_type"), status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user