webcompat.com
webcompat.com copied to clipboard
get_domain is ill defined.
so get_domain helps extracting a domain name from a title.
https://github.com/webcompat/webcompat.com/blob/8656f17526d3b64c367ea4f2bbb742a2b388c937/webcompat/templates/init.py#L79-L90
The function returns the first group of continuous text before a space, but the case return '' is not covered in the testing
https://github.com/webcompat/webcompat.com/blob/8656f17526d3b64c367ea4f2bbb742a2b388c937/tests/unit/test_template.py#L43-L52
and indeed the only case where this would happen is when title = '' which is probably not the initial intent of get_domain.
So
- There's a missing test
- There might be a modification to do to the regex to really match what we want.
which is probably along
'staging.webcompat.com - site is not usable'➡️'staging.webcompat.com''site is not usable'➡️''