mirror of
https://github.com/d0zingcat/cors-anywhere.git
synced 2026-05-13 15:09:25 +00:00
Support NODE_TLS_REJECT_UNAUTHORIZED=0 to ignore client errors #341
Apparently `NODE_TLS_REJECT_UNAUTHORIZED` is only effective if
`rejectUnauthorized` was not overridden by the code:
85e6089c4d/lib/_tls_wrap.js (L1583-L1591)
But the underlying library does override it:
https://github.com/http-party/node-http-proxy/blob/v1.11.1/lib/http-proxy/common.js#L53-L55
Fix this by overriding the option via the library's "secure" option.
This commit is contained in:
@@ -407,6 +407,7 @@ exports.createServer = function createServer(options) {
|
||||
// Default options:
|
||||
var httpProxyOptions = {
|
||||
xfwd: true, // Append X-Forwarded-* headers
|
||||
secure: process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0',
|
||||
};
|
||||
// Allow user to override defaults and add own options
|
||||
if (options.httpProxyOptions) {
|
||||
|
||||
Reference in New Issue
Block a user