mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-03 02:21:05 +08:00
[Network] Keep resource type when redirecting
This patch will change the default behavior to mark redirects as type "Other" to instead have them show up with the same type as the original request. To mark them as redirects, the type column will contain a "/ Redirect" after the original type. Screenshot: https://imgur.com/a/86o2cZV Fixed: chromium:997694 Change-Id: If66f1cfe0de6ff5ae10140248696b62e2ad824af Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2265995 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
8e9501661d
commit
d7ae567263
@@ -823,6 +823,10 @@ export class NetworkRequestNode extends NetworkNode {
|
||||
simpleType = mimeType.replace(/^(application|image)\//, '');
|
||||
}
|
||||
|
||||
if (this._request.isRedirect()) {
|
||||
simpleType += ' / ' + ls`Redirect`;
|
||||
}
|
||||
|
||||
return simpleType;
|
||||
}
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ export class NetworkDispatcher {
|
||||
requestId,
|
||||
loaderId,
|
||||
timestamp,
|
||||
type: Protocol.Network.ResourceType.Other,
|
||||
type: type || Protocol.Network.ResourceType.Other,
|
||||
response: redirectResponse,
|
||||
frameId
|
||||
});
|
||||
|
||||
@@ -90,6 +90,8 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper {
|
||||
this._initiator = initiator;
|
||||
/** @type {?NetworkRequest} */
|
||||
this._redirectSource = null;
|
||||
/** @type {boolean} */
|
||||
this._isRedirect = false;
|
||||
/** @type {?NetworkRequest} */
|
||||
this._redirectDestination = null;
|
||||
this._issueTime = -1;
|
||||
@@ -1455,9 +1457,17 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper {
|
||||
* @param {number} redirectCount
|
||||
*/
|
||||
markAsRedirect(redirectCount) {
|
||||
this._isRedirect = true;
|
||||
this._requestId = `${this._backendRequestId}:redirected.${redirectCount}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
isRedirect() {
|
||||
return this._isRedirect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} requestId
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user