-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from doronz88/refactor/everything
Refactor/everything
- Loading branch information
Showing
8 changed files
with
317 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class HarloggerException(Exception): | ||
pass | ||
|
||
|
||
class HTTPParseError(HarloggerException): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from functools import cached_property | ||
from typing import Optional | ||
|
||
from haralyzer.http import Response | ||
|
||
|
||
class ResponseHook(Response): | ||
@cached_property | ||
def text(self) -> Optional[str]: | ||
""" | ||
:return: Response body | ||
:rtype: str | ||
""" | ||
content = self.raw_entry["content"] | ||
return content.get("_textBase64", content.get("text")) | ||
|
||
|
||
def add_text_base64_support_for_haralyzer() -> None: | ||
setattr(Response, 'text', ResponseHook.text) |
Oops, something went wrong.