Skip to content

HTT header: attach header per-project instead of per-domain #10728

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

Closed
stsewd opened this issue Sep 12, 2023 · 1 comment
Closed

HTT header: attach header per-project instead of per-domain #10728

stsewd opened this issue Sep 12, 2023 · 1 comment
Labels
Needed: design decision A core team decision is required

Comments

@stsewd
Copy link
Member

stsewd commented Sep 12, 2023

What's the problem this feature will solve?

Currently, we allow attaching http headers to custom domains only.

domain = models.ForeignKey(
Domain,
related_name='http_headers',
on_delete=models.CASCADE,
)

This has a couple of problems:

  • If a project adds a new custom domain, we will need to create all current headers for that domain, and we will need to keep in sync all of them in case we change something.
  • We can't have custom http headers for our default domains (readthedocs.io, readthedocs-hosted.com).

Describe the solution you'd like

Instead of attaching the header to a custom domain, we attach it to the project. I don't think there is a case a user will want to have different values per domain, if we find that there is a use case for that, we could keep the old field and support both options.

Alternative solutions

  • Force people to always use a canonical custom domain if they want additional headers.
  • Keep all custom domains from a project in sync manually or have an automatic way of doing it.
  • Create a custom nginx configuration each time we want to add a header to all domains a project is served from.
@stsewd stsewd added the Needed: design decision A core team decision is required label Sep 12, 2023
@humitos
Copy link
Member

humitos commented Sep 15, 2023

This seems a duplicated of #8649. Feel free to move anything from this issue there if there are more context/considerations here that are not there.

@humitos humitos closed this as completed Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

2 participants