Socket
Socket
Sign inDemoInstall

rss-parser

Package Overview
Dependencies
4
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.7.6 to 3.8.0

dist/stats.json

2

index.d.ts
import { Options } from 'xml2js';
import { RequestOptions } from 'https';

@@ -18,2 +19,3 @@ declare namespace Parser {

readonly xml2js?: Options;
readonly requestOptions?: RequestOptions;
readonly headers?: Headers;

@@ -20,0 +22,0 @@ readonly defaultRSS?: number;

11

lib/parser.js

@@ -24,2 +24,3 @@ "use strict";

options.customFields.feed = options.customFields.feed || [];
options.requestOptions = options.requestOptions || {};
if (!options.maxRedirects) options.maxRedirects = DEFAULT_MAX_REDIRECTS;

@@ -78,10 +79,4 @@ if (!options.timeout) options.timeout = DEFAULT_TIMEOUT;

let prom = new Promise((resolve, reject) => {
let req = get({
headers,
auth: urlParts.auth,
protocol: urlParts.protocol,
hostname: urlParts.hostname,
port: urlParts.port,
path: urlParts.path,
}, (res) => {
const requestOpts = Object.assign({headers}, urlParts, this.options.requestOptions);
let req = get(requestOpts, (res) => {
if (this.options.maxRedirects && res.statusCode >= 300 && res.statusCode < 400 && res.headers['location']) {

@@ -88,0 +83,0 @@ if (redirectCount === this.options.maxRedirects) {

{
"name": "rss-parser",
"version": "3.7.6",
"version": "3.8.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

@@ -207,3 +207,16 @@ # rss-parser

### Request passthrough
`rss-parser` uses [http](https://nodejs.org/docs/latest/api/http.html#http_http_get_url_options_callback)/[https](https://nodejs.org/docs/latest/api/https.html#https_https_get_url_options_callback) module
to do requests. You can pass [these options](https://nodejs.org/docs/latest/api/https.html#https_https_request_options_callback)
to `http.get()`/`https.get()` by specifying `options.requestOptions`:
e.g. to allow unauthorized certificate
```js
let parser = new Parser({
requestOptions: {
rejectUnauthorized: false
}
});
```
## Contributing

@@ -210,0 +223,0 @@ Contributions are welcome! If you are adding a feature or fixing a bug, please be sure to add a [test case](https://github.com/bobby-brennan/rss-parser/tree/master/test/input)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc