Skip to content

Commit df481a6

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 parents 927abec + 524b9e4 commit df481a6

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

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
def create_signature(self) -> Signature:
6969
"""Create a default signature"""
7070
return Signature(
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)