gulp-remote-src
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -73,2 +73,10 @@ var remoteSrc = require('./'); | ||
gulp.task('test', ['stream', 'nostream']); | ||
gulp.task('self-signed-ssl', ['clean'], function() { | ||
return remoteSrc(['index.html'], { | ||
strictSSL: false, | ||
base: 'https://example.com/' | ||
}) | ||
.pipe(gulp.dest('dist/stream')); | ||
}); | ||
gulp.task('test', ['stream', 'nostream', 'self-signed-ssl']); |
16
index.js
@@ -25,3 +25,8 @@ var util = require('util'); | ||
return es.readArray(urls).pipe(es.map(function(data, cb) { | ||
var url = options.base + data; | ||
var url = options.base + data, requestOptions = {url: url}; | ||
if (options.strictSSL !== null) { | ||
requestOptions.strictSSL = options.strictSSL; | ||
} | ||
if (!options.buffer) { | ||
@@ -33,3 +38,3 @@ var file = new File({ | ||
// request must be piped out once created, or we'll get this error: "You cannot pipe after data has been emitted from the response." | ||
contents: request(url).pipe(through2()) | ||
contents: request(requestOptions).pipe(through2()) | ||
}); | ||
@@ -39,6 +44,5 @@ | ||
} else { | ||
request({ | ||
url: url, | ||
encoding: null | ||
}, function(error, response, body) { | ||
requestOptions.encoding = null; | ||
request(requestOptions, function(error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
@@ -45,0 +49,0 @@ var file = new File({ |
{ | ||
"name": "gulp-remote-src", | ||
"description": "Remote gulp.src", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -40,2 +40,6 @@ # gulp-remote-src | ||
- `strictSSL` (optional) | ||
passed to `request` to allow self signed SSL certificates | ||
## Changelog | ||
@@ -51,2 +55,6 @@ | ||
Add tests for streaming pipe. | ||
Add tests for streaming pipe. | ||
### v0.2.1 (2014-07-18) | ||
Add option `strictSSL` (thank you [@Magomogo](https://github.com/Magomogo)) |
6890
125
58