firebase / firebase/firebase-js-sdk

FR: read response headers after function call

Open
#2,280 0 comments 0 reactions 0 assignees View on GitHub
api: functions feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [REQUIRED] Describe your environment

* Operating System version: macOS Mojave 10.4.6
* Browser version: Google Chrome 77.0.3865.120
* Firebase SDK version: 7.0.0
* Firebase Product: functions

### [REQUIRED] Describe the problem

#### Steps to reproduce:
Perform any HttpsCallable function, ex:
```javascript
const response = await functions.httpsCallable('myFirebaseFunction');
```
The response will then have all headers stripped. For debugging reasons it would be preferable if these could still be read. A possible solution could be to add extend HttpsCallableOptions with a property to preserve headers, like so:
```javascript
const response = await functions.httpsCallable('myFirebaseFunction', {
preserveHeaders: true
});
```
```javascript
// index.d.ts
export interface HttpsCallableOptions {
timeout?: number;
preserveHeaders?: boolean;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.