Browse Source

Force UTF8 encoding on generated XML (#1140)

closed-social-glitch-2
Eugen 7 years ago
committed by GitHub
parent
commit
1c351709bc
4 changed files with 7 additions and 5 deletions
  1. +1
    -1
      Procfile
  2. +1
    -1
      app/lib/atom_serializer.rb
  3. +4
    -2
      app/views/layouts/application.html.haml
  4. +1
    -1
      config/puma.rb

+ 1
- 1
Procfile View File

@ -1,2 +1,2 @@
web: bundle exec puma -C config/puma.rb web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq -q default -q mailers -q push
worker: bundle exec sidekiq -q default -q push -q pull -q mailers

+ 1
- 1
app/lib/atom_serializer.rb View File

@ -7,7 +7,7 @@ class AtomSerializer
def render(element) def render(element)
document = Ox::Document.new(version: '1.0') document = Ox::Document.new(version: '1.0')
document << element document << element
"<?xml version=\"1.0\"?>#{Ox.dump(element)}"
('<?xml version="1.0"?>' + Ox.dump(element)).force_encoding('UTF-8')
end end
end end

+ 4
- 2
app/views/layouts/application.html.haml View File

@ -11,8 +11,10 @@
%meta{:name => "theme-color", :content => "#282c37"}/ %meta{:name => "theme-color", :content => "#282c37"}/
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/ %meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/
%title
= "#{yield(:page_title)} - " if content_for?(:page_title)
%title<
- if content_for?(:page_title)
= yield(:page_title)
= ' - '
= Setting.site_title = Setting.site_title
= stylesheet_link_tag 'application', media: 'all' = stylesheet_link_tag 'application', media: 'all'

+ 1
- 1
config/puma.rb View File

@ -9,7 +9,7 @@ preload_app!
on_worker_boot do on_worker_boot do
if ENV['HEROKU'] # Spawn the workers from Puma, to only use one dyno if ENV['HEROKU'] # Spawn the workers from Puma, to only use one dyno
@sidekiq_pid ||= spawn('bundle exec sidekiq -q default -q mailers -q push')
@sidekiq_pid ||= spawn('bundle exec sidekiq -q default -q push -q pull -q mailers ')
end end
ActiveRecord::Base.establish_connection if defined?(ActiveRecord) ActiveRecord::Base.establish_connection if defined?(ActiveRecord)

Loading…
Cancel
Save