Skip to content

Commit 85d7b06

Browse files
committed
Attend to review comments
1 parent a40411d commit 85d7b06

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

glean/src/core/upload/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,9 @@ class PingUploader implements PingsDatabaseObserver {
162162
finalBody = gzipSync(encodedBody);
163163
bodySizeInBytes = finalBody.length;
164164
headers["Content-Encoding"] = "gzip";
165-
headers["Content-Length"] = finalBody.length.toString();
166165
} catch {
167166
finalBody = stringifiedBody;
168167
bodySizeInBytes = encodedBody.length;
169-
headers["Content-Length"] = stringifiedBody.length.toString();
170168
}
171169

172170
if (bodySizeInBytes > this.policy.maxPingBodySize) {
@@ -175,6 +173,7 @@ class PingUploader implements PingsDatabaseObserver {
175173
);
176174
}
177175

176+
headers["Content-Length"] = bodySizeInBytes.toString();
178177
return {
179178
headers,
180179
payload: finalBody

glean/tests/unit/core/upload/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function fillUpPingsDatabase(numPings: number): Promise<string[]> {
4141
* Waits for a PingUploader to end its uploading job,
4242
* if it's actualy doing any.
4343
*
44-
* By default will sait for the uploader on the Glean singleton.
44+
* By default will wait for the uploader on the Glean singleton.
4545
*
4646
* @param uploader The uploader to wait for.
4747
*/

0 commit comments

Comments
 (0)