Hack for firebase functions request object, it was read only
(req: Request)
| 26 | |
| 27 | /** Hack for firebase functions request object, it was read only */ |
| 28 | function makeReadonlySettable(req: Request) { |
| 29 | return ['xhr', 'path'].forEach((key) => { |
| 30 | Object.defineProperty(req, key, { |
| 31 | get: function () { |
| 32 | return this[`_${key}`] |
| 33 | }, |
| 34 | set: function (val) { |
| 35 | this[`_${key}`] = val |
| 36 | } |
| 37 | }) |
| 38 | }) |
| 39 | } |