diff --git a/packages/api/src/resolvers/subscriptions/index.ts b/packages/api/src/resolvers/subscriptions/index.ts index 493c0fb31..ab785b73a 100644 --- a/packages/api/src/resolvers/subscriptions/index.ts +++ b/packages/api/src/resolvers/subscriptions/index.ts @@ -193,15 +193,8 @@ export const subscribeResolver = authorized< env: env.server.apiEnv, }, }) - - // validate rss feed - const feed = await parseFeed(input.url) - if (!feed) { - return { - errorCodes: [SubscribeErrorCode.NotFound], - } - } - const feedUrl = feed.url + // use user provided url + const feedUrl = input.url try { validateUrl(feedUrl) } catch (error) { @@ -212,6 +205,14 @@ export const subscribeResolver = authorized< } } + // validate rss feed + const feed = await parseFeed(feedUrl) + if (!feed) { + return { + errorCodes: [SubscribeErrorCode.NotFound], + } + } + // find existing subscription const existingSubscription = await getRepository(Subscription).findOneBy({ url: In([feedUrl, input.url]), // check both user provided url and parsed url