Skip to content

Content Delivery API returns 404 for URL with Japanese characters #18982

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
cf-marc opened this issue Apr 9, 2025 · 16 comments
Closed

Content Delivery API returns 404 for URL with Japanese characters #18982

cf-marc opened this issue Apr 9, 2025 · 16 comments

Comments

@cf-marc
Copy link

cf-marc commented Apr 9, 2025

Which Umbraco version are you using?

13.6

Bug summary

We are using the Umbraco Content Delivery API (/umbraco/delivery/api/v2/content/item/...) to fetch content from a multilingual site. The Japanese version of our site includes URLs with native Japanese characters (e.g., /オフィス).

However, when we try to retrieve content using a Japanese path, we consistently receive a 404 response.

Specifics

No response

Steps to reproduce

Create a page with japanese characters in Umbraco.

Example request:
GET /umbraco/delivery/api/v2/content/item/ja-jp/オフィス
GET /umbraco/delivery/api/v2/content/item/ja-jp/%E3%82%AA%E3%83%95%E3%82%A3%E3%82%B9

Expected result / actual result

Expected behavior:
The API should return the content item matching the path /ja-jp/オフィス if it exists in Umbraco.

Actual behavior:
The API returns a 404 Not Found, despite the item being published and accessible in the CMS.


This item has been added to our backlog AB#51950

Copy link

github-actions bot commented Apr 9, 2025

Hi there @cf-marc!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@AndyButland
Copy link
Contributor

AndyButland commented May 12, 2025

I'm having trouble replicate this one @cf-marc and @andersreus, at least on the latest code for Umbraco 13. I was looking to review the PR but first wanted to reproduce the original issue.

I've created a document under a parent with the URL segment parent and named it "オフィス".

Then tested with the encoded and unencoded requests:

GET /umbraco/delivery/api/v2/content/item/parent/オフィス
GET /umbraco/delivery/api/v2/content/item/parent/%E3%82%AA%E3%83%95%E3%82%A3%E3%82%B9

Both resolve as expected for me.

@andersreus - would you mind please having a second look at your PR, and just see if the change you've made is actually necessary when using the latest code for 13 (i.e. what will be 13.9)? As it's possible this has been resolved in another update since 13.6 when this was originally reported.

@andersreus
Copy link
Contributor

Hey @AndyButland
This is how my content is structured:

Image

When requesting:
GET /umbraco/delivery/api/v2/content/item/ja-jp/オフィス

It still returns 404 on the latest 13.
Let me know if you are missing any information or if I overlooked a detail.

@AndyButland
Copy link
Contributor

I think 404 would be expected there, as there's no path segment named ja-jp. What happens if you request the path for that document, i.e.:

GET /umbraco/delivery/api/v2/content/item/オフィス

@andersreus
Copy link
Contributor

GET /umbraco/delivery/api/v2/content/item/オフィス
Still returns 404.

Requesting the English variant:
GET umbraco/delivery/api/v2/content/item/english-node
Returns 200.

@AndyButland
Copy link
Contributor

That still might be as expected. For the delivery API you have to provide the language in a header if you want to get back the variant for a specific language.

If you provide the header of Accept-Language: ja-JP, does that then work?

See https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api under "Localization".

@andersreus
Copy link
Contributor

Ah, of course, thank you for pointing that out!
Then I get content back on the latest 13👍

@AndyButland
Copy link
Contributor

AndyButland commented May 12, 2025

OK, in which case I think we can close this and your PR for 13. Do you agree?

@andersreus
Copy link
Contributor

Yes, I agree 🙂

@AndyButland
Copy link
Contributor

Closing then, thanks. @cf-marc - not quite sure when, but this issue can't be reproduced in 13.latest, so will be resolved in 13.9 (if it wasn't already in 13.7 and 13.8).

@AndyButland AndyButland removed state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks state/reproduced labels May 13, 2025
@cf-marc
Copy link
Author

cf-marc commented May 19, 2025

Hey @AndyButland,
Thanks for the update.
I’ve updated one of my projects to 13.8.1, but it doesn’t seem to be working as expected.
I created a Japanese node under my Home node:

Image

This is the configuration for my Home node:
Image

I also tried using the Accept-Language header:
/umbraco/delivery/api/v2/content/item/ja-jp/オフィス
Image

/umbraco/delivery/api/v2/content/item/ja-jp/%E3%82%AA%E3%83%95%E3%82%A3%E3%82%B9
Image

Am I missing something?
Interestingly, I can request the home node with the path ja-jp:

Image

@AndyButland
Copy link
Contributor

It's not really clear if the page you have under your home node is published, and if so, under what language.

If you could, please could you try to replicate with as simple as possible setup from a clean install? If you can provide the steps for that and we can replicate, it'll be easier to figure out what's going on.

@cf-marc
Copy link
Author

cf-marc commented May 21, 2025

Hello @AndyButland

I created an empty project using Umbraco 13.8.1. Attached, you’ll find a complete uSync export and the Postman configuration.

We have several projects using the Content Delivery API in this way, supporting multiple cultures. We only use the path without the Accept-Language Header. I'm not sure what I'm doing wrong — thanks in advance for your help.

umbraco-ja-jp.mp4

usync_export_20250521_085812.zip

Umbraco 13.postman_collection.json

@AndyButland
Copy link
Contributor

Thanks for this additional detail and sample @cf-marc - I've been able to replicate and believe I've found how to resolve, which you can see via the PR linked above.

@AndyButland AndyButland self-assigned this May 22, 2025
@cf-marc
Copy link
Author

cf-marc commented May 22, 2025

Thanks a lot for digging into this and for the quick turnaround @AndyButland! I really appreciate your patience throughout.

@nikolajlauridsen
Copy link
Contributor

Fixed in #19390, thanks for reporting 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants