mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Make sure that item URL are absolute
This commit is contained in:
parent
84d912c979
commit
827683ab59
8 changed files with 129 additions and 11 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/miniflux/miniflux/model"
|
||||
"github.com/miniflux/miniflux/reader/date"
|
||||
"github.com/miniflux/miniflux/reader/sanitizer"
|
||||
"github.com/miniflux/miniflux/url"
|
||||
)
|
||||
|
||||
type jsonFeed struct {
|
||||
|
@ -66,6 +67,11 @@ func (j *jsonFeed) Transform() *model.Feed {
|
|||
|
||||
for _, item := range j.Items {
|
||||
entry := item.Transform()
|
||||
entryURL, err := url.AbsoluteURL(feed.SiteURL, entry.URL)
|
||||
if err == nil {
|
||||
entry.URL = entryURL
|
||||
}
|
||||
|
||||
if entry.Author == "" {
|
||||
entry.Author = j.GetAuthor()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue