mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 14:13:38 +08:00
09dc922b3b
add missing icons, update SvgSprite methods (to fix ruby 2.4 issues), update whisper icon in composer, fix alignment issues
24 lines
680 B
Ruby
24 lines
680 B
Ruby
class SvgSpriteController < ApplicationController
|
|
skip_before_action :preload_json, :redirect_to_login_if_required, :check_xhr, :verify_authenticity_token, only: [:show]
|
|
|
|
def show
|
|
|
|
no_cookies
|
|
|
|
RailsMultisite::ConnectionManagement.with_hostname(params[:hostname]) do
|
|
|
|
if SvgSprite.version != params[:version]
|
|
return redirect_to path(SvgSprite.path)
|
|
end
|
|
|
|
svg_sprite = SvgSprite.bundle
|
|
|
|
response.headers["Last-Modified"] = 10.years.ago.httpdate
|
|
response.headers["Content-Length"] = svg_sprite.bytesize.to_s
|
|
immutable_for 1.year
|
|
|
|
render plain: svg_sprite, disposition: nil, content_type: 'image/svg+xml'
|
|
end
|
|
end
|
|
end
|