Adjust brittle referer header check

This commit is contained in:
Matt-Yorkley
2018-02-23 16:35:46 +00:00
parent 9506ea456e
commit 7bd0de99ac

View File

@@ -67,7 +67,8 @@ class ApplicationController < ActionController::Base
def embedded_shopfront_referer
return if request.referer.blank?
URI(request.referer).host.sub!(/^www./, '')
domain = URI(request.referer).host.downcase
domain.start_with?('www.') ? domain[4..-1] : domain
end
def embeddable?