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

Consider changing uSync's default "no content" page's HTTP Status code from 200 to 404/5xx #576

Open
liamlaverty opened this issue Jan 21, 2024 · 2 comments

Comments

@liamlaverty
Copy link
Contributor

liamlaverty commented Jan 21, 2024

Is your feature request related to a problem? Please describe.

When launching a site with uSync installed, and InstallUnattended configured, uSync sometimes returns a page "uSync all the things | You are seeing this page because your site doesn't contain any published content". The page's Http status code is 200. As the page is effectively saying "there's no content here", the page should return 404.

When uSync isn't installed, but Umbraco is launched with InstallUnattended set to true, the default "no content yet" type page returns 400.

I'm trying to use the HTTP status code of a server as an automated check to see if a staging server is ready to promote automatically to production. When using a non-uSync installation, I can check curl --fail http://localhost:80/ || exit 1, and when Umbraco returns 2xx, I can be satisfied that the site is ready to promote to production. In a uSync configured site 2xx is returned, even when a content import failed, so I need to do additional checks.

Describe the solution you'd like
uSync's status code should match the default Umbraco 400 or 500 status code. Ideally the "uSync all the things" page would be a 404, since it indicates no content was found at the address.

Describe alternatives you've considered
My current work-around is to check the HTML content of the homepage for some predictable string. It's not a great long-term solution to the issue though.

Additional context

See screenshot of the 2xx status

usync-200-status-code
@KevinJump
Copy link
Owner

Hi,

what version of Umbraco do you have., for both v10 (v10.8.3) v13 (v13.0.3) a fresh install of Umbraco (no content no packages) the default no-nodes page return 200 🤔 .

v10.8.3
image

v13.0.3
image

I don't mind making uSync return a 404, but if it's not the default behavior, i am worried it might affect other people the opposite way.

@liamlaverty
Copy link
Contributor Author

Looks like I've mis-reported this. The 500 is returned when InstallUnattended is set to false. I might raise a discussion in the Umbraco-CMS repo instead to see if they'd be up for returning 4xx on the InstallUnattended-but-no-content page.

image

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

2 participants