0

What is the best way to read size of a request object sent to Firebase Callable Function?

I would like to take actions based on the size of request sent from a client but the only options I see are:

  • calculating size of the object in a custom function as suggested here.
  • using the object-sizeof npm package.

Is there any build in Firebase solution to this?

Dave
  • 2,255
  • 1
  • 14
  • 31
  • 1
    Normally you would use the headers in the HTTP request to find the size of the payload, but those are not exposed in callable functions. You should file a feature request for that. http://firebase.google.com/support/contact/bugs-features – Doug Stevenson Mar 21 '19 at 15:54
  • Thanks @DougStevenson, I have filed a feature request. Are those exposed in Firebase HTTP Functions? – Dave Mar 21 '19 at 17:12
  • 1
    Yes, HTTP functions give you access to all the headers, just like you would expect from an Express app. – Doug Stevenson Mar 21 '19 at 17:35

0 Answers0