Skip to content

Commit

Permalink
Merge pull request #11 from doronz88/bugfix/serialization
Browse files Browse the repository at this point in the history
sniffers: fix HAR output serialization
  • Loading branch information
doronz88 authored Jan 30, 2024
2 parents 9cbde12 + 6c95165 commit db41a1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions harlogger/sniffers.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def _sniff(self) -> None:
message = line.message

try:
entry = HarEntry(json.loads(incomplete + message))
full_message = json.loads(incomplete + message)
entry = HarEntry(full_message)
incomplete = ''
entry_hash = EntryHash(line.pid,
posixpath.basename(line.filename),
Expand All @@ -132,7 +133,7 @@ def _sniff(self) -> None:
if not self._filters.should_keep(entry_hash):
continue

self.har['log']['entries'].append(entry)
self.har['log']['entries'].append(full_message)
if self._request:
self.show(entry_hash, entry.request.formatted, '➡️')
if self._response:
Expand Down

0 comments on commit db41a1d

Please sign in to comment.