Class: Pageflow::PrimaryDomainEntryRedirect

Inherits:
Object
  • Object
show all
Defined in:
lib/pageflow/primary_domain_entry_redirect.rb

Overview

Use as Configuration#public_entry_redirect to make sure entries are accessed via their account’s configured cname.

Since:

  • 12.4

Instance Method Summary collapse

Instance Method Details

#call(entry, request) ⇒ Object

Since:

  • 12.4



7
8
9
10
11
12
13
14
# File 'lib/pageflow/primary_domain_entry_redirect.rb', line 7

def call(entry, request)
  theming = entry.theming

  if theming.cname.present? &&
     !known_domains(theming).include?(request.host)
    [request.protocol, theming.cname, request.fullpath].join
  end
end