@@ -50,6 +50,26 @@ def test_redirect_scheme_missing(self):
50
50
got = self .client .get ('/r/user.com' )
51
51
self .assertEqual (400 , got .status_code )
52
52
53
+ def test_redirect_not_url (self ):
54
+ got = self .client .get ('/r/foo:bar:baz' )
55
+ self .assertEqual (400 , got .status_code )
56
+
57
+ def test_as2_not_web (self ):
58
+ got = self .client .get ('/r/foo:bar:baz' ,
59
+ headers = {'Accept' : as2 .CONTENT_TYPE_LD_PROFILE })
60
+ self .assertEqual (400 , got .status_code )
61
+
62
+ def test_redirect_bsky_app_url (self ):
63
+ got = self .client .get ('/r/https://bsky.app/profile/.bsky.social' )
64
+ self .assertEqual (301 , got .status_code )
65
+ self .assertEqual ('https://bsky.app/profile/.bsky.social' ,
66
+ got .headers ['Location' ])
67
+
68
+ def test_as2_bsky_app_url (self ):
69
+ got = self .client .get ('/r/https://bsky.app/profile/.bsky.social' ,
70
+ headers = {'Accept' : as2 .CONTENT_TYPE_LD_PROFILE })
71
+ self .assertEqual (404 , got .status_code )
72
+
53
73
def test_redirect_url_missing (self ):
54
74
got = self .client .get ('/r/' )
55
75
self .assertEqual (404 , got .status_code )
0 commit comments