Bug 1636804 - Remove quotes and escaping for header sections r=nchevobbe a=pascalc FIREFOX_RELEASE_77_BASE
authorHubert Boma Manilla <hmanilla@mozilla.com>
Wed, 20 May 2020 14:41:00 +0000
changeset 591568 63896e87d70e6d0323efba7d51f1ee2d7df21b69
parent 591567 6deceec9bafc3947e6456ba87072f7e93c53e95d
child 591569 cf5de4cbb547a5e64ba7d688bd57ff486064b17f
push id13183
push userarchaeopteryx@coole-files.de
push dateMon, 25 May 2020 12:03:53 +0000
treeherdermozilla-beta@63896e87d70e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe, pascalc
bugs1636804
milestone77.0
Bug 1636804 - Remove quotes and escaping for header sections r=nchevobbe a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D76111
devtools/client/netmonitor/src/components/request-details/HeadersPanel.js
devtools/client/netmonitor/src/components/request-details/PropertiesView.js
devtools/client/netmonitor/test/browser_net_post-data-03.js
devtools/client/netmonitor/test/browser_net_simple-request-details.js
--- a/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js
+++ b/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js
@@ -457,16 +457,17 @@ class HeadersPanel extends Component {
           object: this.getProperties(responseHeaders, RESPONSE_HEADERS),
           filterText,
           targetSearchResult,
           renderRow: this.renderRow,
           renderValue: this.renderValue,
           provider: HeadersProvider,
           selectPath: this.getTargetHeaderPath,
           defaultSelectFirstNode: false,
+          useQuotes: false,
         },
         header: this.getHeadersTitle(responseHeaders, RESPONSE_HEADERS),
         buttons: this.renderRawHeadersBtn(
           "response",
           rawResponseHeadersOpened,
           this.toggleRawResponseHeaders
         ),
         id: "responseHeaders",
@@ -483,16 +484,17 @@ class HeadersPanel extends Component {
           object: this.getProperties(requestHeaders, REQUEST_HEADERS),
           filterText,
           targetSearchResult,
           renderRow: this.renderRow,
           renderValue: this.renderValue,
           provider: HeadersProvider,
           selectPath: this.getTargetHeaderPath,
           defaultSelectFirstNode: false,
+          useQuotes: false,
         },
         header: this.getHeadersTitle(requestHeaders, REQUEST_HEADERS),
         buttons: this.renderRawHeadersBtn(
           "request",
           rawRequestHeadersOpened,
           this.toggleRawRequestHeaders
         ),
         id: "requestHeaders",
@@ -515,16 +517,17 @@ class HeadersPanel extends Component {
           ),
           filterText,
           targetSearchResult,
           renderRow: this.renderRow,
           renderValue: this.renderValue,
           provider: HeadersProvider,
           selectPath: this.getTargetHeaderPath,
           defaultSelectFirstNode: false,
+          useQuotes: false,
         },
         header: this.getHeadersTitle(
           uploadHeaders,
           REQUEST_HEADERS_FROM_UPLOAD
         ),
         buttons: this.renderRawHeadersBtn(
           "upload",
           rawUploadHeadersOpened,
--- a/devtools/client/netmonitor/src/components/request-details/PropertiesView.js
+++ b/devtools/client/netmonitor/src/components/request-details/PropertiesView.js
@@ -57,25 +57,27 @@ class PropertiesView extends Component {
       expandedNodes: PropTypes.object,
       filterText: PropTypes.string,
       cropLimit: PropTypes.number,
       targetSearchResult: PropTypes.object,
       resetTargetSearchResult: PropTypes.func,
       selectPath: PropTypes.func,
       mode: PropTypes.symbol,
       defaultSelectFirstNode: PropTypes.bool,
+      useQuotes: PropTypes.bool,
     };
   }
 
   static get defaultProps() {
     return {
       enableInput: true,
       enableFilter: true,
       expandableStrings: false,
       cropLimit: 1024,
+      useQuotes: true,
     };
   }
 
   constructor(props) {
     super(props);
     this.onFilter = this.onFilter.bind(this);
     this.renderValueWithRep = this.renderValueWithRep.bind(this);
     this.getSelectedPath = this.getSelectedPath.bind(this);
@@ -191,31 +193,32 @@ class PropertiesView extends Component {
       object,
       renderRow,
       renderValue,
       provider,
       targetSearchResult,
       selectPath,
       cropLimit,
       defaultSelectFirstNode,
+      useQuotes,
     } = this.props;
 
     return div(
       { className: "properties-view" },
       div(
         { className: "tree-container" },
         TreeView({
           ref: () => this.scrollSelectedIntoView(),
           object,
           provider,
           columns: [{ id: "value", width: "100%" }],
           decorator,
           enableInput,
           expandableStrings,
-          useQuotes: true,
+          useQuotes,
           expandedNodes:
             expandedNodes ||
             TreeViewClass.getExpandedNodes(object, {
               maxLevel: AUTO_EXPAND_MAX_LEVEL,
               maxNodes: AUTO_EXPAND_MAX_NODES,
             }),
           onFilter: props => this.onFilter(props),
           renderRow,
--- a/devtools/client/netmonitor/test/browser_net_post-data-03.js
+++ b/devtools/client/netmonitor/test/browser_net_post-data-03.js
@@ -54,27 +54,27 @@ add_task(async function() {
 
   is(
     labels[labels.length - 2].textContent,
     "content-type",
     "The first request header name was incorrect."
   );
   is(
     values[values.length - 2].textContent,
-    '"application/x-www-form-urlencoded"',
+    "application/x-www-form-urlencoded",
     "The first request header value was incorrect."
   );
   is(
     labels[labels.length - 1].textContent,
     "custom-header",
     "The second request header name was incorrect."
   );
   is(
     values[values.length - 1].textContent,
-    '"hello world!"',
+    "hello world!",
     "The second request header value was incorrect."
   );
 
   // Wait for all tree sections updated by react
   wait = waitForDOM(document, "#request-panel .accordion-item", 2);
   EventUtils.sendMouseEvent(
     { type: "click" },
     document.querySelector("#request-tab")
--- a/devtools/client/netmonitor/test/browser_net_simple-request-details.js
+++ b/devtools/client/netmonitor/test/browser_net_simple-request-details.js
@@ -203,17 +203,17 @@ add_task(async function() {
     responseHeaders.forEach(header => {
       is(
         responseScope[header.index - 1].querySelector(".treeLabel").innerHTML,
         header.name,
         `The ${header.pos} response header name was incorrect.`
       );
       is(
         responseScope[header.index - 1].querySelector(".objectBox").innerHTML,
-        `"${header.value}"`,
+        `${header.value}`,
         `The ${header.pos} response header value was incorrect.`
       );
     });
 
     const requestHeaders = [
       {
         name: "Cache-Control",
         value: "no-cache",
@@ -242,17 +242,17 @@ add_task(async function() {
     requestHeaders.forEach(header => {
       is(
         requestScope[header.index - 1].querySelector(".treeLabel").innerHTML,
         header.name,
         `The ${header.pos} request header name was incorrect.`
       );
       is(
         requestScope[header.index - 1].querySelector(".objectBox").innerHTML,
-        `"${header.value}"`,
+        `${header.value}`,
         `The ${header.pos} request header value was incorrect.`
       );
     });
   }
 
   async function testCookiesTab() {
     const tabpanel = await selectTab(PANELS.COOKIES, 1);