Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] support gzip payload in cdp interceptor #28486

Merged

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Apr 26, 2024

Why

close ENG-10620
fixes #25353

How

okhttp interceptor does not uncompress gzip payload by default, and we sent compressed data to devtools. this pr tries to uncompress gzip data if necessary. ideally we don't want to touch the response body so we clone data for cdp.

Test Plan

  1. add PeekResponseBodyTest unit test
  2. add the following code from DevTool network inspector can't resolve GZIP requests #25353 and add the code snippet to bare-expo App.tsx. then test from devtools network inspector
async function runAsync() {
  const response = await fetch('https://jsonplaceholder.typicode.com/posts/7', {
    headers: {
      'Accept-Encoding': 'gzip',
      'Cache-Control': 'no-cache',
    },
  });
  const result = await response.json();
  console.log('runAsync', result);
}
setTimeout(runAsync, 3000);

Checklist

Copy link

linear bot commented Apr 26, 2024

@expo-bot expo-bot added bot: suggestions ExpoBot has some suggestions bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 26, 2024
@expo-bot
Copy link
Collaborator

expo-bot commented Apr 26, 2024

The Pull Request introduced fingerprint changes against the base commit: 3fa69ae

Fingerprint diff
[
  {
    "type": "dir",
    "filePath": "../../packages/expo-modules-core/android",
    "reasons": [
      "expoAutolinkingAndroid"
    ],
    "hash": "45617709d75d90c4c7c0991e2be24b85b20fef8a"
  }
]

Generated by PR labeler 🤖

@Kudo Kudo force-pushed the @kudo/eng-10620-devtool-network-inspector-cant-resolve-gzip-requests branch from 363987b to 2abd0cb Compare April 26, 2024 17:14
@Kudo Kudo marked this pull request as ready for review April 26, 2024 18:28
@Kudo Kudo merged commit f4416eb into main Apr 27, 2024
3 checks passed
@Kudo Kudo deleted the @kudo/eng-10620-devtool-network-inspector-cant-resolve-gzip-requests branch April 27, 2024 03:24
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DevTool network inspector can't resolve GZIP requests
4 participants