firebase / firebase/firebase-android-sdk

Content-Length omitted by OkHttp so payload size is not reported in Firebase

Open
#952 3 comments 1 reaction 0 assignees View on GitHub
api: performance type: feature request
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

Description

### [READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in __the code in this repository__.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

* For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
with the firebase tag.
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk)
google group.
* For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
[Firebase support channel](https://firebase.google.com/support/).

### [REQUIRED] Step 2: Describe your environment

* Android Studio version: 3.5.1
* Firebase Component: Performance
* Component version: 19.1.0

### [REQUIRED] Step 3: Describe the problem

#### Steps to reproduce:

When using Firebase Performance Monitoring (automatic http metrics) with OkHttp, the response payload size is not reported to Firebase.

The reason is if OkHttp does transparent gzip decompression, the library omits the `Content-Length` header, and hence Firebase is unable to report it.

I do not know what would be better -

- Intercept requests at network level rather than application level
- Check body.length instead of `Content-Length`

Here is more details about the issue on OkHttp
https://github.com/square/okhttp/issues/259#issuecomment-547986658

#### Relevant Code:

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.