Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RCTInspectorNetworkReporterhas no way to report a redirect.NetworkReporter::reportRequestStartalready takes an optional redirect response, which it sends asNetwork.requestWillBeSent'sredirectResponse, but the Objective-C method always passesstd::nullopt. Networking stacks that report through it in place ofRCTNetworkingshow a redirected request in the Network panel as one request, with the original URL and the final response.Motivation
Expo is moving
expo/fetch,expo-imageandexpo-assetontoRCTInspectorNetworkReporter, in place of its own CDP relay in Expo CLI, which reports each redirect hop.expo/fetchfollows redirects in its ownURLSessiondelegate, and reports each hop fromwillPerformHTTPRedirectionwith this method.Changes
reportRequestStart:request:encodedDataLength:redirectResponse:, which reports a request sent after a redirect under the same request id, with the redirect response's URL, status and headers.reportRequestStart:request:encodedDataLength:through it, with no redirect response.PerformanceResourceTimingis unchanged:NetworkReporterkeeps the entry from the first request, so itsnameandfetchStartstay those of the original request. Android'sInspectorNetworkReporterhas no equivalent yet.Changelog:
[iOS][Added] - React Native DevTools:
RCTInspectorNetworkReportermethod to report redirects, for networking stacks that replaceRCTNetworkingTest Plan
Built Expo's
bare-expoapp from source against React Native 0.89.0-rc.2, whose copy of these files is identical tomain, with this change applied, and withexpo/fetchcalling the new method fromwillPerformHTTPRedirection:expo/fetchrequest tohttps://httpbin.org/redirect/2produced, under one request id:ℹ️ Adds the method to the four
ReactApplesnapshots. TheReactAndroidviews failed locally on an unrelated Doxygen parse error infmt's headers.