Handle file paths as not found in delivery API by route requests#19063
Merged
AndyButland merged 3 commits intov13/devfrom Apr 22, 2025
Merged
Conversation
kjac
approved these changes
Apr 19, 2025
Contributor
kjac
left a comment
There was a problem hiding this comment.
Works like a charm. Good stuff!
I renamed "resolveable" to "resolvable" - Google says that's the correct spelling 🤷
1 task
This was referenced Sep 30, 2025
This was referenced Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prerequisites
Resolves: #19051
Description
As the linked issue shows, a request to the delivery API to retrieve a content item by route will fail with a 500 rather than a 404 for a file path request. This is because there's no Umbraco context available for these requests and an exception is thrown as one is expected to exist.
In this update I've checked for a file request and where found, immediately return null and hence 404 to the caller.
Note that this doesn't happen on 15 - due to the removal of the "published snapshot" - a 404 is returned already on this version. So the fix is needed only for 15.
Testing
/umbraco/delivery/api/v2/content/item/my-folder/my-page, and verify the expected 200 response is returned./umbraco/delivery/api/v2/content/item/my-folder/my-missing-page, and verify the expected 404 response is returned./umbraco/delivery/api/v2/content/item/my-folder/my-file.txt, and verify that now a 404 response is returned.