유니코드 카테고리 슬러그가 404 오류를 유발합니다

프로덕션 인스턴스와 개발 인스턴스 모두에서 발생하는 문제입니다.

재현 단계:

  1. 유니코드 슬러그를 가진 카테고리를 변경/생성합니다.
  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}

슬러그 생성 방법 설정을 인코딩으로 변경하면 문제가 해결되지만, 우리 토픽 URL에 인코딩된 슬러그는 정말로 원치 않습니다

1개의 좋아요