googleapis / nodejs-projectify

A simple utility for replacing the projectId token in objects.
Apache License 2.0
8 stars 6 forks source link

fix: replaceProjectId should not fail when passed a Buffer #43

Closed jkwlui closed 6 years ago

jkwlui commented 6 years ago

Fixes GCS OOM issue: https://github.com/googleapis/nodejs-storage/issues/489

This bug was introduced when we converted from using is.object(..) to typeof .. === 'object'. While typeof buffer === 'object', is.object(buffer) === false.

We should also probably back-patch v2.0 and v2.1 of the GCS library to fix this bug.

JustinBeckwith commented 6 years ago

Oooooops. Welp that's good to know, and a little scary. I don't think we need to backport, because a semver patch release will float downstream.