(options)
| 2428 | // currently implements pre-authorization |
| 2429 | // TODO: support preAuth = false where it hooks on 401 |
| 2430 | prepareRequest(options) { |
| 2431 | if (!options.headers) { |
| 2432 | throw Error('The request has no headers'); |
| 2433 | } |
| 2434 | options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; |
| 2435 | } |
| 2436 | // This handler cannot handle 401 |
| 2437 | canHandleAuthentication() { |
| 2438 | return false; |