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

Commit

Permalink
use feed URL if url not startWith http
Browse files Browse the repository at this point in the history
  • Loading branch information
wyy931 committed Aug 6, 2023
1 parent 8f05896 commit ec227ee
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/ObjC/RSRSSParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,12 @@ - (NSString *)urlString:(NSString *)s {
return s;
}

if (!self.link) {
if (!self.link || ![self.link hasPrefix:@"http"]) {
NSURL *feedURL = [NSURL URLWithString:self.urlString];
if (!feedURL) {
return s;
}
NSURL *baseURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", feedURL.scheme, feedURL.host]];
if (!baseURL) {
return s;
}
NSURL *resolvedURL = [NSURL URLWithString:s relativeToURL:baseURL];
NSURL *resolvedURL = [NSURL URLWithString:s relativeToURL:feedURL];
if (resolvedURL.absoluteString) {
return resolvedURL.absoluteString;
}
Expand Down

0 comments on commit ec227ee

Please sign in to comment.