| 62 | } |
| 63 | |
| 64 | function buildAccessors(obj, header) { |
| 65 | const accessorName = utils.toCamelCase(' ' + header); |
| 66 | |
| 67 | ['get', 'set', 'has'].forEach((methodName) => { |
| 68 | Object.defineProperty(obj, methodName + accessorName, { |
| 69 | // Null-proto descriptor so a polluted Object.prototype.get cannot turn |
| 70 | // this data descriptor into an accessor descriptor on the way in. |
| 71 | __proto__: null, |
| 72 | value: function (arg1, arg2, arg3) { |
| 73 | return this[methodName].call(this, header, arg1, arg2, arg3); |
| 74 | }, |
| 75 | configurable: true, |
| 76 | }); |
| 77 | }); |
| 78 | } |
| 79 | |
| 80 | class AxiosHeaders { |
| 81 | constructor(headers) { |