blankie 2023-12-09 16:41:25 +11:00
parent bda0bff294
commit 8088a8aff9
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,8 @@ static inline void preprocess_html(const httplib::Request& req, const std::strin
}
}
static std::regex mention_class_re("\\bmention\\b");
// examples of mention and hashtag: https://anarres.family/@ashten@social.platypus-sandbox.com/111532064387673301
static std::regex proxy_class_re("\\b(mention|hashtag)\\b");
static inline void preprocess_link(const httplib::Request& req, const std::string& domain_name, lxb_dom_element_t* element) {
using namespace std::string_literals;
@ -147,9 +148,8 @@ static inline void preprocess_link(const httplib::Request& req, const std::strin
instance_url_base.set(CURLUPART_SCHEME, "https");
instance_url_base.set(CURLUPART_HOST, domain_name);
// .mention is used in note and posts
// Instance base is used for link fields
if (std::regex_search(cls, mention_class_re) || starts_with(href_url, instance_url_base)) {
if (std::regex_search(cls, proxy_class_re) || starts_with(href_url, instance_url_base)) {
// Proxy this instance's URLs to Coyote
href = proxy_mastodon_url(req, std::move(href));