fixup! feat: allow non-ASCII announce and webseed URLs (#8420) (#8447)

This commit is contained in:
Yat Ho
2026-02-13 01:36:23 +08:00
committed by GitHub
parent 6943855f7d
commit 89b8e9ae9d
2 changed files with 7 additions and 7 deletions

View File

@@ -13,12 +13,12 @@
#include "libtransmission/announce-list.h"
#include "tr-strbuf.h"
#include "libtransmission/error.h"
#include "libtransmission/file-utils.h"
#include "libtransmission/quark.h"
#include "libtransmission/string-utils.h"
#include "libtransmission/tr-assert.h"
#include "libtransmission/tr-strbuf.h"
#include "libtransmission/types.h"
#include "libtransmission/variant.h"
#include "libtransmission/web-utils.h"
@@ -81,10 +81,10 @@ bool tr_announce_list::replace(tr_tracker_id_t id, std::string_view announce_url
bool tr_announce_list::add(std::string_view announce_url, tr_tracker_tier_t tier)
{
// This step allows for URLs that contain character outside the allowed set
// This step allows for URLs that contain characters outside the allowed set
// defined by RFC 3986. The URL we store is "equivalent" to the provided URL
// according to the definition in RFC 3986 Section 6.1, while consisting
// of only ASCII characters. This ensures the URLs be represented correctly
// according to the definition in RFC 3986 Section 6.1, while consisting of
// only US-ASCII characters. This ensures the URLs be represented correctly
// when transmitted via UTF-8 mediums, for example JSON.
auto normalized_url = tr_urlbuf{};
tr_urlPercentEncode(std::back_inserter(normalized_url), announce_url, false);

View File

@@ -200,10 +200,10 @@ void tr_magnet_metainfo::set_name(std::string_view name)
void tr_magnet_metainfo::add_webseed(std::string_view webseed)
{
// This step allows for URLs that contain character outside the allowed set
// This step allows for URLs that contain characters outside the allowed set
// defined by RFC 3986. The URL we store is "equivalent" to the provided URL
// according to the definition in RFC 3986 Section 6.1, while consisting
// of only ASCII characters. This ensures the URLs be represented correctly
// according to the definition in RFC 3986 Section 6.1, while consisting of
// only US-ASCII characters. This ensures the URLs be represented correctly
// when transmitted via UTF-8 mediums, for example JSON.
auto normalized = tr_urlbuf{};
tr_urlPercentEncode(std::back_inserter(normalized), webseed, false);