]> git.openstreetmap.org Git - rails.git/commitdiff
Set canonical port based on protocol
authorTom Hughes <tom@compton.nu>
Wed, 22 Mar 2017 19:28:57 +0000 (19:28 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 22 Mar 2017 19:28:57 +0000 (19:28 +0000)
config/initializers/canonical_rails.rb

index c443c8bf816461d99b77043a5bd4416d62c13323..0d1461ed7b153758d893a1216a602a3f9ef792e8 100644 (file)
@@ -6,6 +6,7 @@ CanonicalRails.setup do |config|
   # This is the main host, not just the TLD, omit slashes and protocol. If you have more than one, pick the one you want to rank in search results.
 
   config.host = SERVER_URL
+  config.port = SERVER_PROTOCOL == "https" ? 443 : 80
 
   # http://en.wikipedia.org/wiki/URL_normalization
   # Trailing slash represents semantics of a directory, ie a collection view - implying an :index get route;