Skip to content

Commit 451260e

Browse files
committed
fix: properly handle b64 encoded block with newlines
1 parent cc6dfbf commit 451260e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

har2tree/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def parse_data_uri(uri: str) -> tuple[str, str, bytes] | None:
8888
mime, b64data = uri.split(';base64', 1)
8989
if not b64data or b64data[0] != ',':
9090
return None
91-
b64data = b64data[1:].strip()
91+
b64data = b64data[1:].strip().replace('\n', '')
9292
if not re.fullmatch('[A-Za-z0-9+/]*={0,2}', b64data):
9393
return None
9494
if len(b64data) % 4:

0 commit comments

Comments
 (0)