Merge pull request #1833 from coreos-inc/fix-tar-gz

Fix tar-gz reading of Dockerfiles
This commit is contained in:
josephschorr 2016-09-13 20:24:11 -04:00 committed by GitHub
commit 58641cbf4f
2 changed files with 4 additions and 5 deletions

View file

@ -45,7 +45,7 @@ angular.module('quay').factory('DataFileService', [function() {
};
dataFileService.tryAsTarGz_ = function(buf, success, failure) {
var gunzip = new Zlib.Gunzip(buf);
var gunzip = new Zlib.Gunzip(new Uint8Array(buf));
var plain = null;
try {
@ -56,8 +56,7 @@ angular.module('quay').factory('DataFileService', [function() {
}
if (plain.byteLength == 0) {
success([]);
return;
plain = buf;
}
dataFileService.tryAsTar_(plain, success, failure);
@ -77,7 +76,7 @@ angular.module('quay').factory('DataFileService', [function() {
return parts.join('/');
};
var handler = new Untar(buf);
var handler = new Untar(new Uint8Array(buf));
handler.process(function(status, read, files, err) {
switch (status) {
case 'error':

View file

@ -371,7 +371,7 @@ if (!Array.prototype.some) {
* @param data The data, in Uint8Array form.
*/
function Untar(data) {
this.data = [];
this.data = data;
}
Untar.prototype.process = function(cb, opt_filter) {