(opts)
| 771 | } |
| 772 | |
| 773 | initGotEnv(opts) { |
| 774 | this.got = this.got ? this.got : require('got') |
| 775 | this.cktough = this.cktough ? this.cktough : require('tough-cookie') |
| 776 | this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar() |
| 777 | if (opts) { |
| 778 | opts.headers = opts.headers ? opts.headers : {} |
| 779 | if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { |
| 780 | opts.cookieJar = this.ckjar |
| 781 | } |
| 782 | } |
| 783 | } |
| 784 | |
| 785 | get(opts, callback = () => {}) { |
| 786 | if (opts.headers) { |