gulp-awspublish
gulp-awspublish copied to clipboard
utf8 BOM is stripped from text files on upload
All files should be transferred as binaries.
i've discovered the problem as I tried to upload an installer. It has a list of files and their sha1 hashes generated during build. My installer was failing with the sha1 hash mismatch error and upon investigation I've confirmed that gulp-awspublish strips BOM from utf8 encoded text files.
i figured it out, it's actually gulp fault. Gulp depends on an ancient version of vinyl that strips BOM by default.
to fix the issue gulp.src should be replaced with:
var vinyl = require('vinyl-fs'); vinyl.src("files/*/", {stripBOM : false})
and then it will works as expected.
maybe you guys want to add it to readme?
Thanks for the investigation @kether667 !
I also looked into this and it seems like it won't be fixed in gulp3 (see: https://github.com/gulpjs/gulp/issues/1557), but adding this to the Readme is a good idea!
I will add it and close this story once this is done.
Wow, this bit me as well; after loading a signed application using this plugin it failed validation because the BOM was altered on the upload.
Seriously nasty bug, and very difficult to track down.