Skip to content

Proxito 404: serve custom 404 page from default version on external/PR domains #10683

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

Open
stsewd opened this issue Aug 29, 2023 · 1 comment
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@stsewd
Copy link
Member

stsewd commented Aug 29, 2023

What's the problem this feature will solve?

When serving external versions, we force all calls to storage to be to /external/html/... by setting the self.version_type attribute at the start of the request

if unresolved_domain.is_from_external_domain:
self.version_type = EXTERNAL

storage_root_path = project.get_storage_path(
type_="html",
version_slug=version_404.slug,
include_file=False,
version_type=self.version_type,
)

Which is good, but when handling 404s, we try to serve the 404.html file from the default version, which isn't external, and obviously it doesn't exist in the /external/ path.

Describe the solution you'd like

We need to decide what do to in this case:

  • Skip serving custom 404s from the default version when we are on an external domain.
  • Allow serving the content from the default version, if so, we need to remove the dependency on self.version_type Proxito: remove version_type #10220.

Additional context

#10220

@stsewd stsewd added the Needed: design decision A core team decision is required label Aug 29, 2023
@humitos humitos added the Improvement Minor improvement to code label Aug 31, 2023
@humitos
Copy link
Member

humitos commented Aug 31, 2023

Skip serving custom 404s from the default version when we are on an external domain.

I think this "solution" is fine for now. I don't think we need to complicate this too much.

I find a little weird the case where the "PR doesn't have a 404.html but the default version does". The other way around seems more common, but that's tracked/solved in #10690, so 👍🏼

I wouldn't do anything at this point for this particular issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

2 participants