Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

The HAR output is incompatible with the original HAR-Viewer #131

@monitorjbl

Description

@monitorjbl

Describe the bug
The output HAR for a proxy does not work with the original HAR-Viewer. When uploading the HAR output from browserup-proxy, the following output is observed:


log.entries[0].response.redirectURL |   |   | is missing and it is not optional
log.entries[0].response.content.size |   |   | is missing and it is not optional
log.entries[1].response.redirectURL |   |   | is missing and it is not optional
log.entries[1].response.content.size |   |   | is missing and it is not optional
log.entries[2].response.redirectURL |   |   | is missing and it is not optional

To Reproduce
Steps to reproduce the behavior:

  1. Create a proxy
  2. Enabled HAR logging for the proxy
  3. Start a client browser using the proxy and navigate to any page
  4. Export the HAR file from the proxy
  5. Upload the HAR file to the online HAR Viewer: http://www.softwareishard.com/har/viewer/

Expected behavior
The HAR file is parsed and rendered

Screenshots
image

Please complete the following information:

  • OS: macOS 10.14.5
  • Browser Chrome
  • Version 75.0.3770.142

Additional context
After monkeying about with the code, it appears that the issue is rooted in the model classes that were ported from the original project. There are some default values being set that are not valid HAR output for the Viewer when they are not fully populated. After removing some of these default values, the HAR file can be parsed. Of note are the following fields:

  • HarResponse.redirectURL <-- This should default to an empty String value instead of null
  • HarContent.size <-- This should default to 0 instead of null
  • HarLog.browser <-- This should default to null instead of an empty HarCreatorBrowser

There are likely many more, but these are the ones I noticed in my testing.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions