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

Avoid returning invalid domain when using USE_SUBDOMAIN=True in dev #6026

Merged
merged 1 commit into from
Aug 21, 2019
Merged
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
2 changes: 1 addition & 1 deletion readthedocs/core/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def process_request(self, request):
# Serve CNAMEs
if (
public_domain not in host and
settings.PRODUCTION_DOMAIN not in host and
settings.PRODUCTION_DOMAIN not in (host, full_host) and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the same as the previous logic. This is checking that production_domain is exactly the same as host or full_host. Or that is what this change is for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's the intended change and it's because in development the PRODUCTION_DOMAIN contains the port which is not in host but it's on full_host.

'localhost' not in host and
'testserver' not in host
):
Expand Down