Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment subscription emails should not respect HTTPS. Fixes #598 #705

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ group :development do
gem 'rb-inotify', require: false
gem 'rb-fsevent', require: false
gem 'rb-fchange', require: false
gem 'rb-readline', platforms: %i[mingw mswin x64_mingw]
gem 'brakeman', require: false
end
end
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ GEM
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rb-readline (0.5.5)
ref (2.0.0)
regexp_parser (2.1.1)
request_store (1.5.0)
rack (>= 1.4)
Expand Down Expand Up @@ -425,6 +427,8 @@ GEM
timecop (0.9.4)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo-data (1.2017.3)
tzinfo (>= 1.0.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.7.0)
Expand Down Expand Up @@ -506,6 +510,7 @@ DEPENDENCIES
rb-fchange
rb-fsevent
rb-inotify
rb-readline
responders (~> 3.0)
responds_to_parent!
rspec-activemodel-mocks
Expand Down
1 change: 1 addition & 0 deletions lib/fat_free_crm/gem_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require "fat_free_crm/gem_ext/active_support/buffered_logger"
require "fat_free_crm/gem_ext/active_support/polymorphic_url"
require "fat_free_crm/gem_ext/action_controller/base"
require "fat_free_crm/gem_ext/rake/task" if defined?(Rake)
19 changes: 19 additions & 0 deletions lib/fat_free_crm/gem_ext/active_support/polymorphic_url.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------

# Fixes https://github.com/rails/rails/pull/31746
module FatFreeCRM
module SecurePolymorphicUrl
def polymorphic_url(record_or_hash_or_array, options = {})
options[:secure] = true if Rails.configuration.force_ssl
super(record_or_hash_or_array, options)
end
end
end

ActionDispatch::Routing::PolymorphicRoutes.send(:prepend, FatFreeCRM::SecurePolymorphicUrl)