chrome-har icon indicating copy to clipboard operation
chrome-har copied to clipboard

Wrong value type for entry request params

Open vlad4800 opened this issue 6 years ago • 2 comments

The value field should be a string according to: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html#sec-object-types-params, instead it is an object.

This doesn't happen all the time, but sometimes it does. So if the value is a Json, I think it should be escaped, somehow, to not break the RFC.

I just replaced the title and url.

value [string, optional] - value of a posted parameter or content of a posted file.

{
  "request": {
    "method": "GET",
    "postData": {
      "params": [
        {
          "name": "feedUrls",
          "value": {
            "Title": "xxTitlexx",
            "Url": "xxUrlxx",
            "ImageHandling": 1
          }
        }
      ]
    }
  }
}

vlad4800 avatar Jul 09 '18 09:07 vlad4800

Thanks @vlad4800 for creating the issue! Let us take a look at it when we get a chance, at the moment we are in vacation mode, see https://github.com/sitespeedio/sitespeed.io#vacation-july---august

If you could start a PR however that would be super.

Best Peter

soulgalore avatar Jul 09 '18 21:07 soulgalore

The solution is probably just to delete these lines: https://github.com/sitespeedio/chrome-har/blob/master/index.js#L763-L768 Trying to fit JSON encoded post data into anything but a plain text is just a fool's errand.

tobli avatar Jul 10 '18 09:07 tobli