actually fixed addFile to allow leading '/' this time...
This commit is contained in:
		
							父節點
							
								
									cbc33c3578
								
							
						
					
					
						當前提交
						6a0661d493
					
				| @ -138,8 +138,10 @@ function dumpCerts(certs) { | ||||
|       + "module.exports.addFile = function (filepath) {\n" | ||||
|       + "  var opts = require('https').globalAgent.options;\n" | ||||
|       + "  var root = filepath[0] === '/' ? '/' : '';\n" | ||||
|       + "  var filepaths = filepath.split(/\\//g);\n" | ||||
|       + "  if (root) { filepaths.unshift(root); }\n" | ||||
|       + "  opts.ca = opts.ca || [];\n" | ||||
|       + "  opts.ca.push(require('fs').readFileSync(require('path').join.apply(null, (root + filepath).split(/\\//g))));\n" | ||||
|       + "  opts.ca.push(require('fs').readFileSync(require('path').join.apply(null, filepaths)));\n" | ||||
|       + "  return module.exports;\n" | ||||
|       + "};\n" | ||||
|   ); | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "ssl-root-cas", | ||||
|   "version": "1.1.1", | ||||
|   "version": "1.1.2", | ||||
|   "description": "The module you need to solve node's SSL woes when including a custom certificate.", | ||||
|   "main": "ssl-root-cas", | ||||
|   "scripts": { | ||||
|  | ||||
| @ -4104,7 +4104,9 @@ module.exports.inject = function () { | ||||
| module.exports.addFile = function (filepath) { | ||||
|   var opts = require('https').globalAgent.options; | ||||
|   var root = filepath[0] === '/' ? '/' : ''; | ||||
|   var filepaths = filepath.split(/\//g); | ||||
|   if (root) { filepaths.unshift(root); } | ||||
|   opts.ca = opts.ca || []; | ||||
|   opts.ca.push(require('fs').readFileSync(require('path').join.apply(null, (root + filepath).split(/\//g)))); | ||||
|   opts.ca.push(require('fs').readFileSync(require('path').join.apply(null, filepaths))); | ||||
|   return module.exports; | ||||
| }; | ||||
|  | ||||
		載入中…
	
	
			
			x
			
			
		
	
		新增問題並參考
	
	Block a user