title: How to send a file from cloud storage using response.sendFile in cloud functions?
body: <p>I'm trying to send a response back to a client using an http trigger from firebase cloud functions.
  When I sent the response using the file location from Cloud Storage, the sendFile method throws this error:</p>
  
  <pre><code>"path must be absolute or specify root to res.sendFile"
  
  res.sendFile(obj.path(param1, param2, param3, param4));
  </code></pre>
  
  <p>obj.path(param1, param2, param3, param4) this builds a path to gs:// or an https:// with the params.</p>
  
  <p>Then I decided to do this:</p>
  
  <pre><code>const rp = require("request-promise");
  
  exports.fun = functions.https.onRequest( async (req, res) =&gt; {
  let extResponse = await rp('firebase storage location');
            extResponse.pipe(res);
  });
  </code></pre>
  
  <p>rp is now returning this error:</p>
  
  <pre><code>StatusCodeError: 403 - "{\n  \"error\": {\n    \"code\": 403,\n    \"message\": \"Permission denied. Could not perform this operation\"\n  }\n}"
  </code></pre>
  
  <p>This error is because cloud storage requires the request to be authenticated in order to let the service download the file from storage.</p>
  
  <p>Is there a way to make this work and return the file back to the client?   </p>