Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf481a6

Browse files
authored
Merge pull request#45 from MozillaSecurity/hostname-escape
Use json.dumps instead of a naive format string to generate the report signature
2 parents927abec +524b9e4 commitdf481a6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

‎src/webcompat/models.py‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,13 @@ def load(cls, data: str) -> Report:
6868
defcreate_signature(self)->Signature:
6969
"""Create a default signature"""
7070
returnSignature(
71-
f"""
72-
{{
73-
"symptoms": [
74-
{{
75-
"type": "url",
76-
"part": "hostname",
77-
"value": "{self.url.hostname}"
78-
}}
79-
]
80-
}}
81-
"""
71+
json.dumps(
72+
{
73+
"symptoms": [
74+
{"type":"url","part":"hostname","value":self.url.hostname}
75+
]
76+
}
77+
)
8278
)
8379

8480

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp