gulp-awspublish icon indicating copy to clipboard operation
gulp-awspublish copied to clipboard

utf8 BOM is stripped from text files on upload

Open lukasz-karolewski opened this issue 8 years ago • 3 comments

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.

lukasz-karolewski avatar Apr 03 '16 23:04 lukasz-karolewski

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?

lukasz-karolewski avatar Apr 04 '16 04:04 lukasz-karolewski

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.

RichardOtvos avatar May 04 '16 16:05 RichardOtvos

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.

shadowmint avatar Jan 05 '17 06:01 shadowmint