Hubert Boma Manilla 0a4230aa64 Bug 1758361 - [devtools] Fix crash when viewing request headers from upload stream r=nchevobbe
This patch fixes 2 crashes, for different reasons and improves/ adds tests to cover the issues
- The raw view of the `Request headers for upload stream` crashes when there
  is only one header sent. This is covered by the scenario

  ```
  [
    "content-type: application/x-www-form-urlencoded\r",
    "\r",
    "\r",
    "foo=bar&baz=123"
  ]
  ```

- The Request side panel crashes when there is no form data body content added to the payload sent.
  This is covered in the test by the scenario

  ```
  [
    "content-type: application/x-www-form-urlencoded\r",
    "\r",
    "\r",
  ]
  ```

Differential Revision: https://phabricator.services.mozilla.com/D143339
2022-04-15 08:16:17 +00:00
..