Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

get feed URL and use that to resolve URL if link is empty #77

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wyy931
Copy link

@wyy931 wyy931 commented Apr 30, 2023

No description provided.

Comment on lines 307 to 311
NSURL *baseURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", feedURL.scheme, feedURL.host]];
if (!baseURL) {
return s;
}
NSURL *resolvedURL = [NSURL URLWithString:s relativeToURL:baseURL];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the baseURL step? My thinking is that we get the resolvedURL using the feedURL, something like:

NSURL *resolvedURL = [NSURL URLWithString:s relativeToURL:feedURL];

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize, but I'm not well-acquainted with the NSURL API

@wyy912
Copy link

wyy912 commented May 14, 2023

In the situation I encountered, the RSS subscription address is https://www.fuli51.net/feed, rather than https://www.fuli51.net/. The parsed articleUrl is a number, which when concatenated forms the resolvedURL, such as https://www.fuli51.net/123456. If the baseURL is not used, it would become https://www.fuli51.net/feed/123456, resulting in the article being inaccessible. I am unsure if this is an exceptional case that I have come across.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants