HTTPS for fontello.com looks like enforced
Closed this issue · 5 comments
Hi !
I created a new project using latest version today, when building, I received this error :
[15:56:40] Error: Invalid filename
at new module.exports (???\node_modules\adm-zip\adm-zip.js:23:10)
at processResponse ???\node_modules\gulp-fontello\lib\index.js:39:15)
at ???\node_modules\gulp-fontello\lib\index.js:90:11
at done (???\node_modules\needle\lib\needle.js:468:14)
at PassThrough.<anonymous> (???\node_modules\needle\lib\needle.js:719:9)
at PassThrough.emit (events.js:311:20)
at PassThrough.EventEmitter.emit (domain.js:505:15)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Then, when printing the file, got this:
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.17.6</center>
</body>
</html>
It was solved un-intrusively by updating the host in the option with the https url equivalent.
This bug could also be solved in the lib by updating this line to https as, by default, the gulp task will not execute well (tried on previous project to regen the glyphs, exact same issue):
HOST = 'http://fontello.com',
I'm not sure where the isssue is coming from as on the fontello git page the http url is still given and once the problem solved, I didn't diged deeper. Also, I could wget with 0 redirect the http url (wget --max-redirect=0 http://fontello.com), so I'm kind of confused but don't know what exact url was retrieved by the lib, yet, don't work unless specifying https. If you can't repro on your side and it end up not being related to gulp-fontello, let me know.
Have a great day
I'm experiencing the same error, but changing the host to https doesn't solve it for me. Here is what my task looks like:
gulp.task('fontello', function () {
return gulp.src('fontello.json')
.pipe(plumber({errorHandler: function(err) {
notify.onError({
title: "Gulp: [fontello]",
subtitle: "Error",
message: "<%= error.message %>",
sound: false
})(err);
this.emit('end');
}}))
.pipe(fontello({
host: 'https://fontello.com',
font: 'fonts/icons',
css: 'styles/sass/vendor/icons'
}))
.pipe(rename(function(file) {
if (file.extname == '.css') {
file.extname = '.scss';
}
}))
.pipe(gulp.dest('../assets/'))
});
Actually nevermind: I can confirm that @Manu404's fix works. I delete my npm directory, re-ran npm install, then added the host option per above and all is well. +1 to updating the lib to reflect https
Actually nevermind: I can confirm that @Manu404's fix works. I delete my npm directory, re-ran npm install, then added the host option per above and all is well. +1 to updating the lib to reflect https
Great to ear that ! Not sure if the project maintainer is still active, if I have time, will branch/fix/merge request tonight, it's quite straight forward, to make his life a bit easier :)