Closed nkanaev closed 4 years ago
Absolute link in ParseURL.
ParseURL
Relative links are provided as is.
script to test:
package main import ( "fmt" "github.com/mmcdole/gofeed" ) func main() { parser := gofeed.NewParser() feed, _ := parser.ParseURL("https://bou.ke/feed.xml") fmt.Println(feed.Link) // outputs "/" fmt.Println(feed.FeedLink) // outputs "/feed.xml" }
partial file content:
<feed xmlns="http://www.w3.org/2005/Atom"> <generator uri="https://jekyllrb.com/" version="4.0.1">Jekyll</generator> <link href="/feed.xml" rel="self" type="application/atom+xml"/> <link href="/" rel="alternate" type="text/html"/> <updated>2020-07-13T09:26:52+00:00</updated> ...
Full feed is provided here: bouke.xml
Given that such links have to be handled manually in Parse, ParseString methods anyways, I'd like to hear opinions on whether it's worth implementing the fix, or should be the library users' responsibility.
Parse
ParseString
Expected behavior
Absolute link in
ParseURL
.Actual behavior
Relative links are provided as is.
Steps to reproduce the behavior
script to test:
partial file content:
Full feed is provided here: bouke.xml
Notes
Given that such links have to be handled manually in
Parse
,ParseString
methods anyways, I'd like to hear opinions on whether it's worth implementing the fix, or should be the library users' responsibility.