Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPE_INVALID_HEADER_TOKEN error due to Invalid header value char #230

Open
EpsilonTal opened this issue Aug 16, 2022 · 0 comments
Open

HPE_INVALID_HEADER_TOKEN error due to Invalid header value char #230

EpsilonTal opened this issue Aug 16, 2022 · 0 comments

Comments

@EpsilonTal
Copy link

EpsilonTal commented Aug 16, 2022

Hello,

Following the readme file, using
NodeJS 12
and
"rss-parser": "^3.12.0"

I start my app using
nodemon nodemon --http-parser=legacy app/

The content language is 'Hebrew'

I receive the following error, after initializing the parser:

let Parser = require('rss-parser');
...
let parser = new Parser();
let feed = await parser.parseURL('https://..../rss/xml.xml');
console.log(feed.title);
      
feed.items.forEach(item => {
  console.log(item.title + ':' + item.link)
});

Error:

Error: Parse Error
    at TLSSocket.socketOnData (_http_client.js:452:22)
    at TLSSocket.emit (events.js:196:13)
    at addChunk (_stream_readable.js:290:12)
    at readableAddChunk (_stream_readable.js:271:11)
    at TLSSocket.Readable.push (_stream_readable.js:226:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:166:17) {
  bytesParsed: 707,
  code: 'HPE_INVALID_HEADER_TOKEN',
  reason: 'Invalid header value char'
}

Does the rss-parser work with node12?
Any header you might suggest I should add to the parser?

UPDATE -> After testing with another RSS such as https://www.reddit.com/.rss, it worked.
So I guess the response language does matter.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant