Issue 2078: 404 for archive post bad slug #2083
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is my attempt to set 404 status if an archive has segments (slug) that don't match to a valid path, as described in issue #2078
This does handle bad slugs and pages (such as /archive/page/notanumber and /archive/tag/non-existant-slug but doesn't handle empty pages tags or categories (/archive/tag or /archive/page) as I'm not sure what the best behavior is in that case.
I also didn't add any tests for this, as I haven't explored that area of the solution yet; if that's a requirement to accept the pr I will definitely spend some time reviewing that and see if I can add this as well.
I'd appreciate any feedback on this change, as this is my first attempt at contributing to an OSS project, thanks!