kopia lustrzana https://github.com/snarfed/bridgy-fed
/r/ redirect endpoint: use HTTP 301, not 302
rodzic
06cd35abba
commit
6b4089efe4
|
@ -45,7 +45,7 @@ class RedirectHandler(common.Handler):
|
|||
|
||||
# redirect
|
||||
logging.info('redirecting to %s', to)
|
||||
self.redirect(to)
|
||||
self.redirect(to, permanent=True)
|
||||
|
||||
def convert_to_as2(self, url):
|
||||
"""Fetch a URL as HTML, convert it to AS2, and return it.
|
||||
|
|
|
@ -20,7 +20,7 @@ class RedirectTest(testutil.TestCase):
|
|||
|
||||
def test_redirect(self):
|
||||
got = application.get_response('/r/https://foo.com/bar?baz=baj&biff')
|
||||
self.assertEqual(302, got.status_int)
|
||||
self.assertEqual(301, got.status_int)
|
||||
self.assertEqual('https://foo.com/bar?baz=baj&biff', got.headers['Location'])
|
||||
|
||||
def test_redirect_scheme_missing(self):
|
||||
|
|
Ładowanie…
Reference in New Issue