rss-parser icon indicating copy to clipboard operation
rss-parser copied to clipboard

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

Open wlucjan opened this issue 4 years ago • 1 comments

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.

wlucjan avatar Feb 11 '21 15:02 wlucjan

That is very weird. Maybe a caching thing?

rbren avatar Feb 19 '21 19:02 rbren