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

Description
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:
- Create a proxy
- Enabled HAR logging for the proxy
- Start a client browser using the proxy and navigate to any page
- Export the HAR file from the proxy
- 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

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.