solr-proxy
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -0,1 +1,7 @@ | ||
4.1.0 | ||
===== | ||
* Add new option `maxStart` that defaults to `1000`. (Thanks @tuolumne!) | ||
* Drop testing for EOL Node.js 13.x. | ||
4.0.0 | ||
@@ -2,0 +8,0 @@ ===== |
10
index.js
@@ -37,2 +37,9 @@ var { URL } = require('url') | ||
if (paramPrefix === 'start') { | ||
var start = +p[1] | ||
if (start > options.maxStart) { | ||
return true | ||
} | ||
} | ||
return options.invalidParams.indexOf(paramPrefix) !== -1 | ||
@@ -55,3 +62,4 @@ })) { | ||
}, | ||
maxRows: 200 | ||
maxRows: 200, | ||
maxStart: 1000 | ||
} | ||
@@ -58,0 +66,0 @@ |
@@ -30,2 +30,6 @@ var createProxyOptions = function (argv) { | ||
if (+argv.maxStart) { | ||
proxyOptions.maxStart = +argv.maxStart | ||
} | ||
return proxyOptions | ||
@@ -47,2 +51,3 @@ } | ||
' --maxRows Maximum rows permitted in a request [default: 200]\n' + | ||
' --maxStart Maximum start offset permitted in a request [default: 1000]\n' + | ||
' --quiet, -q Do not write messages to STDOUT\n' + | ||
@@ -49,0 +54,0 @@ ' --version, -v Show version\n' + |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"author": "Rich Trott <rtrott@gmail.com>", | ||
@@ -40,3 +40,3 @@ "bugs": { | ||
"devDependencies": { | ||
"@hapi/lab": "^22.0.4", | ||
"@hapi/lab": "^23.0.0", | ||
"code": "^5.2.4", | ||
@@ -43,0 +43,0 @@ "dependency-check": "^4.1.0", |
@@ -46,2 +46,3 @@ solr-proxy | ||
--maxRows Maximum rows permitted in a request [default: 200] | ||
--maxStart Maximum start offset permitted in a request [default: 1000] | ||
--quiet, -q Do not write messages to STDOUT | ||
@@ -92,3 +93,4 @@ --version, -v Show version | ||
To enable verbose logging, set environment variable `DEBUG` to include `solr-proxy`. | ||
To enable verbose logging, set environment variable `DEBUG` to include | ||
`solr-proxy`. | ||
@@ -103,2 +105,4 @@ Default Rules | ||
* Block requests with `qt` and `stream.*` query parameters. | ||
* Reject requests with `rows` set to more than 200. | ||
* Reject requests with `start` set to more than 1000. | ||
@@ -105,0 +109,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11653
161
117