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

Conversation

@humitos
Copy link
Member

commented Aug 1, 2019

When running in development with USE_SUBDOMAIN=True and
PRODUCTION_DOMAIN=dev.readthedocs.io:8000 we receive an error when
accessing the docs.

This allows this case to succeed,
skip these checks and serve the docs properly.

Avoid returning invalid domain when using USE_SUBDOMAIN=True in dev
When running in development with USE_SUBDOMAIN=True and
PRODUCTION_DOMAIN=dev.readthedocs.io:8000 we receive an error when
accessing the docs.

This allows this case to succeed,
skip these checks and serve the docs properly.
@@ -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

This comment has been minimized.

Copy link
@stsewd

stsewd Aug 1, 2019

Member

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?

This comment has been minimized.

Copy link
@humitos

humitos Aug 12, 2019

Author Member

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.

@humitos humitos requested a review from readthedocs/core Aug 21, 2019

@stsewd
stsewd approved these changes Aug 21, 2019

@humitos humitos merged commit 83f7b66 into master Aug 21, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details

@humitos humitos deleted the humitos/use-subdomain-locally branch Aug 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.