One other issue is that, when i run a curl to the API, searching for the topic ID of an embed URL, i can’t find it because of the trailing slash. Discourse returns a 404 page.
But if i remove the trailing slash, it returns the value:
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}%
To make it work, i would need to make a str replace in wordpress, to remove the trailing slash of the permalink, before checking. But this makes no sense, the canonical URL has the trailing slash…
In practice, Discourse is normalizing the permalink to a URL that doesn’t exist… the normalized version should be the one with a trailing slash.