Can't retrieve published story for language code with underscore

We’ve faced with an issue where story that is seemingly published for a language with underscore ("_") in the code is not returned by API when queried with “published-only” filter although it’s present when using “drafts-only” filter.

Steps to reproduce:

  1. Create a language with underscore in the code (e.g. nl_NL)
  2. Create a story that has content in default language and a one containing underscore character in the code
  3. Publish the story for both languages

Expected result:
/v2/cdn/stories/%story-path%?cv=%latest cv%&version=published&language=nl_NL returns published version
Actual result:
Received 404 ["This record could not be found"]

Hello @konstantin.azizov,

can you get in touch with us in the support chat when this issue is still happening, please?

We need some further details about the space configuration and the complete request when you still need help. You can find the chat widget on our page in the bottom right corner:

Best regards