rbren / rss-parser

A lightweight RSS parser, for Node and the browser
MIT License
1.38k stars 209 forks source link

Consecutive calls with url pointing to non-rss url give different errors #193

Open wlucjan opened 3 years ago

wlucjan commented 3 years ago

Hi, I was writing tests and by accident discovered that I get two different error results for the same URL if I run the parseURL consecutively.

Code to reproduce:

const Parser = require('rss-parser');

const parser = new Parser();

const url = 'https://soundcloud.com/inspected';

(async () => {
  try {
    await parser.parseURL(url);
  } catch (error) {
    console.log(error);
  }

  try {
    await parser.parseURL(url);
  } catch (error) {
    console.log(error);
  }
})();

Output received:

Error: Invalid character in entity name
Line: 52
Column: 139
Char: &

and

Error: Feed not recognized as RSS 1 or 2.

Expected would be to get second error in both cases.

rbren commented 3 years ago

That is very weird. Maybe a caching thing?