node-osmosis icon indicating copy to clipboard operation
node-osmosis copied to clipboard

header and headers options are not working

Open ghost opened this issue 7 years ago • 1 comments

osmosis.header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8')

gives error

var opts = this.getOpts(), headers;
                    ^

TypeError: this.getOpts is not a function
    at module.exports (F:\node\node_modules\osmosis\lib\commands\header.js:14:21)
    at F:\node\node_modules\osmosis\lib\Command.js:468:22
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

ghost avatar Feb 04 '18 10:02 ghost

You should use .config or .header after .get. Runtime commands are applied to previous context command, not to next one. It's not so obvious, but it works)

samogot avatar May 12 '18 19:05 samogot