Unicodeカテゴリのスラッグが404エラーを引き起こす

本番環境および開発環境の両方で発生しています。

再現手順:

  1. Unicode スラッグを持つカテゴリを変更または作成する
  2. カテゴリ設定の編集を試みる
  3. 404 エラーが表示される

http://localhost:4200/c/测试/find_by_slug.json のレスポンス:

{
"errors": [
"The requested URL or resource could not be found."
],
"error_type": "not_found",
"extras": {
"html": "<div class=\"page-not-found\">\n  <h1 class=\"title\">Oops! That page doesn’t exist or is private.</h1>\n\n\n</div>\n\n\n\n<div class=\"row page-not-found-topics\">\n    <div class=\"recent-topics\">\n      <h2 class=\"recent-topics-title\">Recent</h2>\n        <div class='not-found-topic'>\n          <a href=\"/t/welcome-to-discourse/7\">Welcome to Discourse</a>\n        </div>\n      <a href=\"/latest\" class=\"btn btn-default\">More&hellip;</a>\n    </div>\n</div>\n\n\n  <div class=\"row\">\n    <div class=\"page-not-found-search\">\n      <h2>Search this site</h2>\n      <p>\n        <form action='/search' id='discourse-search'>\n          <input type=\"text\" name=\"q\" value=\"\">\n          <button class=\"btn btn-primary\">Search</button>\n        </form>\n      </p>\n    </div>\n  </div>\n\n  <link rel=\"preload\" href=\"/assets/onpopstate-handler.js?1621234483.753622\" as=\"script\">\n<script src=\"/assets/onpopstate-handler.js?1621234483.753622\"></script>\n\n"
}
}

追加情報:

  • unicode usernames 設定は無効化されています
  • unicode usernames を有効にしても発生し続けます
  • allowed unicode username characters = \p{Han}

スラッグ生成方法をencodedに変更することで問題は解決しましたが、トピックのURLにエンコードされたスラッグを使いたくはありません。

「いいね!」 1