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

Documentation on Hostname Aliases Unclear #919

Open
robyurkowski opened this issue Sep 14, 2020 · 0 comments
Open

Documentation on Hostname Aliases Unclear #919

robyurkowski opened this issue Sep 14, 2020 · 0 comments

Comments

@robyurkowski
Copy link

Note: For general questions and feature requests please leave a message
on Gitter: https://gitter.im/comfy/comfortable-mexican-sofa

Expected behavior

Based on the documentation included in config/initializers/comfortable_mexican_sofa.rb...

  # Site aliases, if you want to have aliases for your site. Good for harmonizing
  # production env with dev/testing envs.
  # e.g. config.hostname_aliases = {'host.com' => 'host.inv', 'host_a.com' => ['host.lvh.me', 'host.dev']}
  # Default is nil (not used)

... there's no mention of needing to include the port with host aliases.

So it appears at first glance that if you:

  1. Create a site with host myhost.com, a layout, and a basic page;
  2. Change config.hostname_aliases = { "myhost.com" => "myhost.lvh.me" };
  3. Reload the server;
  4. Visit myhost.lvh.me

You should be served that basic page for myhost.com.

Actual behavior

However, if you're running in the standard Rails dev mode and serving off of port 3000, site lookup fails.

Steps to reproduce

This line in BaseController.rb:

::Comfy::Cms::Site.find_site(request.host_with_port.downcase, request.fullpath)

... shows that the port is taken into consideration.

I'm happy to make a patch to improve the documentation in the initializer, but I wanted to check that you want to consider the port first.

System configuration

Rails version: 6.0

CMS version: 2.0.19

Ruby version: 2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant