/r/: drop "User not found for domain" message on 404

security through obscurity (heh), no need to signal that spammers can make a user somehow to get their redirects working.
flask
Ryan Barrett 2021-03-11 20:31:48 -08:00
rodzic f9e8a5abd2
commit 2bae0c999c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -31,7 +31,6 @@ class RedirectHandler(common.Handler):
e.g. redirects /r/https://foo.com/bar?baz to https://foo.com/bar?baz
"""
@cache_response(CACHE_TIME)
def get(self):
assert self.request.path_qs.startswith('/r/')
@ -47,7 +46,8 @@ class RedirectHandler(common.Handler):
logging.info(f'Found MagicKey for domain {domain}')
break
else:
self.error(f'No user found for any of {domains}', status=404)
logging.info(f'No user found for any of {domains}; returning 404')
self.abort(404)
# poor man's conneg, only handle single Accept values, not multiple with
# priorities.