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

Commit ec227ee

Browse files
committed
use feed URL if url not startWith http
1 parent 8f05896 commit ec227ee

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Sources/ObjC/RSRSSParser.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,12 @@ - (NSString *)urlString:(NSString *)s {
299299
return s;
300300
}
301301

302-
if (!self.link) {
302+
if (!self.link || ![self.link hasPrefix:@"http"]) {
303303
NSURL *feedURL = [NSURL URLWithString:self.urlString];
304304
if (!feedURL) {
305305
return s;
306306
}
307-
NSURL *baseURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", feedURL.scheme, feedURL.host]];
308-
if (!baseURL) {
309-
return s;
310-
}
311-
NSURL *resolvedURL = [NSURL URLWithString:s relativeToURL:baseURL];
307+
NSURL *resolvedURL = [NSURL URLWithString:s relativeToURL:feedURL];
312308
if (resolvedURL.absoluteString) {
313309
return resolvedURL.absoluteString;
314310
}

0 commit comments

Comments
 (0)