Discourse 中嵌入 URL 的不一致性

接续自 “Show Full Post” button doesn’t work in subfolder installations 的讨论:

@angus 提到 Discourse 会移除嵌入 URL 末尾的斜杠,以避免某些冲突。

因此,现在 https://domain.com/path-to-url/ 会被保存为 https://domain.com/path-to-url

依我看,这会导致更多不一致。如果我尝试检查 API,以获取嵌入 URL 的主题 ID,我找不到它,因为有尾部斜杠。Discourse 返回一个 404 页面。

但是,如果我移除尾部斜杠,它会返回该值:

mobilon@Thiagos-MacBook-Pro ~ % curl 'https://tecnoblog.net/comunidade/embed/info?embed_url=https://tecnoblog.net/noticias/anatel-e-receita-apreendem-quase-meio-milhao-de-produtos-em-santa-catarina/' -H 'API-KEY: <API KEY>' -H 'API-USERNAME: <USERNAME>'

<!DOCTYPE html>

<html lang="pt-BR">

<head>

  <meta charset="utf-8">

  <title>Página não encontrada - Tecnoblog Comunidade</title>

mobilon@Thiagos-MacBook-Pro ~ % curl 'https://tecnoblog.net/comunidade/embed/info?embed_url=https://tecnoblog.net/noticias/anatel-e-receita-apreendem-quase-meio-milhao-de-produtos-em-santa-catarina' -H 'API-KEY: <API KEY>' -H 'API-USERNAME: <USERNAME>' 

{"topic_id":157645,"post_id":484103,"topic_slug":"anatel-e-receita-apreendem-quase-meio-milhao-de-produtos-em-santa-catarina-tecnoblog","comment_count":15}%     

为了能够找到正确的主题,我需要在 WordPress 中使用字符串替换,在检查 API 之前移除永久链接的尾部斜杠。这没有意义,因为规范 URL 实际上带有尾部斜杠……

换句话说,这就像 Discourse 将永久链接规范化为一个不存在的 URL。