mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
RSS may have relative URI
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Kruzya.TelegramBot.RichSiteSummary.Data
|
|||||||
|
|
||||||
protected override string ViewableUrl
|
protected override string ViewableUrl
|
||||||
{
|
{
|
||||||
get => UtmUtility.ApplyParameters(Url, new UtmParameters()
|
get => UtmUtility.ApplyParameters(new Uri(new(Feed.Url), Url), new UtmParameters()
|
||||||
{
|
{
|
||||||
Source = "telegram",
|
Source = "telegram",
|
||||||
Type = "rss_post",
|
Type = "rss_post",
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ namespace Kruzya.TelegramBot.RichSiteSummary.UrchinTrackingModule
|
|||||||
public class UtmUtility
|
public class UtmUtility
|
||||||
{
|
{
|
||||||
public static string ApplyParameters(string url, UtmParameters parameters)
|
public static string ApplyParameters(string url, UtmParameters parameters)
|
||||||
|
=> ApplyParameters(new Uri(url), parameters);
|
||||||
|
|
||||||
|
public static string ApplyParameters(Uri uri, UtmParameters parameters)
|
||||||
{
|
{
|
||||||
var uri = new Uri(url);
|
|
||||||
var query = HttpUtility.ParseQueryString(uri.Query);
|
var query = HttpUtility.ParseQueryString(uri.Query);
|
||||||
|
|
||||||
SetIfNotNull(query, "utm_source", parameters.Source);
|
SetIfNotNull(query, "utm_source", parameters.Source);
|
||||||
|
|||||||
Reference in New Issue
Block a user