Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,13 +887,18 @@ Container.prototype.copy = function(opts, callback) {

/**
* getArchive
* @param {Object} opts Archive options, like 'path'
* @param {Object} opts Archive options, like 'path'. As a special case,
* allows `headers`, which will set the HTTP headers used on the request.
* Use this to set `headers: { 'Accept-Encoding': 'gzip' }` to get a gzipped
* tar.
* @param {Function} callback Callback with stream.
*/
Container.prototype.getArchive = function(opts, callback) {
var self = this;
var args = util.processArgs(opts, callback, this.defaultOptions.getArchive);

const { headers, ...otherOpts } = args.opts;

var optsf = {
path: '/containers/' + this.id + '/archive?',
method: 'GET',
Expand All @@ -905,7 +910,8 @@ Container.prototype.getArchive = function(opts, callback) {
404: 'no such container',
500: 'server error'
},
options: args.opts
options: otherOpts,
headers,
};

if(args.callback === undefined) {
Expand Down