diff options
author | Yarden Shoham <git@yardenshoham.com> | 2024-01-20 04:38:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-20 02:38:16 +0000 |
commit | 5574968ecbc34908dfa17b28bfc79c3490eaa685 (patch) | |
tree | 42153c81097ae969fbdad9d07eeb3d3a9c569b09 /routers | |
parent | b9d91694afc4b2b52220450927107e6f44f9a7bd (diff) | |
download | gitea-5574968ecbc34908dfa17b28bfc79c3490eaa685.tar.gz gitea-5574968ecbc34908dfa17b28bfc79c3490eaa685.zip |
Set the `isPermaLink` attribute to `false` in the `guid` sub-element (#28860)
Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.
Example:
```diff
<item>
<title>yardenshoham opened issue <a href="https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2">yardenshoham/test#2</a></title>
<link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</link>
<description>2#hey</description>
<content:encoded><![CDATA[2#hey]]></content:encoded>
<author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
<pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```
References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes https://github.com/go-gitea/gitea/issues/28734
- https://github.com/gorilla/feeds/issues/78
- https://github.com/go-gitea/gitea/pull/21550
- https://github.com/gorilla/feeds/pull/107
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/feed/convert.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/web/feed/convert.go b/routers/web/feed/convert.go index 95b1062253..6dbc2c2cbc 100644 --- a/routers/web/feed/convert.go +++ b/routers/web/feed/convert.go @@ -244,6 +244,7 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio Title: title, Link: link, Description: desc, + IsPermaLink: "false", Author: &feeds.Author{ Name: act.ActUser.DisplayName(), Email: act.ActUser.GetEmail(), |