@@ -162,7 +162,7 @@ def test_cache_returns_correct_type(self) -> None:
162
162
163
163
channel = self .make_request (
164
164
"GET" ,
165
- "preview_url?url=http://matrix.org" ,
165
+ "v3/ preview_url?url=http://matrix.org" ,
166
166
shorthand = False ,
167
167
await_result = False ,
168
168
)
@@ -186,7 +186,7 @@ def test_cache_returns_correct_type(self) -> None:
186
186
187
187
# Check the cache returns the correct response
188
188
channel = self .make_request (
189
- "GET" , "preview_url?url=http://matrix.org" , shorthand = False
189
+ "GET" , "v3/ preview_url?url=http://matrix.org" , shorthand = False
190
190
)
191
191
192
192
# Check the cache response has the same content
@@ -202,7 +202,7 @@ def test_cache_returns_correct_type(self) -> None:
202
202
203
203
# Check the database cache returns the correct response
204
204
channel = self .make_request (
205
- "GET" , "preview_url?url=http://matrix.org" , shorthand = False
205
+ "GET" , "v3/ preview_url?url=http://matrix.org" , shorthand = False
206
206
)
207
207
208
208
# Check the cache response has the same content
@@ -224,7 +224,7 @@ def test_non_ascii_preview_httpequiv(self) -> None:
224
224
225
225
channel = self .make_request (
226
226
"GET" ,
227
- "preview_url?url=http://matrix.org" ,
227
+ "v3/ preview_url?url=http://matrix.org" ,
228
228
shorthand = False ,
229
229
await_result = False ,
230
230
)
@@ -254,7 +254,7 @@ def test_video_rejected(self) -> None:
254
254
255
255
channel = self .make_request (
256
256
"GET" ,
257
- "preview_url?url=http://matrix.org" ,
257
+ "v3/ preview_url?url=http://matrix.org" ,
258
258
shorthand = False ,
259
259
await_result = False ,
260
260
)
@@ -290,7 +290,7 @@ def test_audio_rejected(self) -> None:
290
290
291
291
channel = self .make_request (
292
292
"GET" ,
293
- "preview_url?url=http://matrix.org" ,
293
+ "v3/ preview_url?url=http://matrix.org" ,
294
294
shorthand = False ,
295
295
await_result = False ,
296
296
)
@@ -331,7 +331,7 @@ def test_non_ascii_preview_content_type(self) -> None:
331
331
332
332
channel = self .make_request (
333
333
"GET" ,
334
- "preview_url?url=http://matrix.org" ,
334
+ "v3/ preview_url?url=http://matrix.org" ,
335
335
shorthand = False ,
336
336
await_result = False ,
337
337
)
@@ -366,7 +366,7 @@ def test_overlong_title(self) -> None:
366
366
367
367
channel = self .make_request (
368
368
"GET" ,
369
- "preview_url?url=http://matrix.org" ,
369
+ "v3/ preview_url?url=http://matrix.org" ,
370
370
shorthand = False ,
371
371
await_result = False ,
372
372
)
@@ -399,7 +399,7 @@ def test_ipaddr(self) -> None:
399
399
400
400
channel = self .make_request (
401
401
"GET" ,
402
- "preview_url?url=http://example.com" ,
402
+ "v3/ preview_url?url=http://example.com" ,
403
403
shorthand = False ,
404
404
await_result = False ,
405
405
)
@@ -428,7 +428,7 @@ def test_blacklisted_ip_specific(self) -> None:
428
428
self .lookups ["example.com" ] = [(IPv4Address , "192.168.1.1" )]
429
429
430
430
channel = self .make_request (
431
- "GET" , "preview_url?url=http://example.com" , shorthand = False
431
+ "GET" , "v3/ preview_url?url=http://example.com" , shorthand = False
432
432
)
433
433
434
434
# No requests made.
@@ -449,7 +449,7 @@ def test_blacklisted_ip_range(self) -> None:
449
449
self .lookups ["example.com" ] = [(IPv4Address , "1.1.1.2" )]
450
450
451
451
channel = self .make_request (
452
- "GET" , "preview_url?url=http://example.com" , shorthand = False
452
+ "GET" , "v3/ preview_url?url=http://example.com" , shorthand = False
453
453
)
454
454
455
455
self .assertEqual (channel .code , 502 )
@@ -466,7 +466,7 @@ def test_blacklisted_ip_specific_direct(self) -> None:
466
466
Blacklisted IP addresses, accessed directly, are not spidered.
467
467
"""
468
468
channel = self .make_request (
469
- "GET" , "preview_url?url=http://192.168.1.1" , shorthand = False
469
+ "GET" , "v3/ preview_url?url=http://192.168.1.1" , shorthand = False
470
470
)
471
471
472
472
# No requests made.
@@ -485,7 +485,7 @@ def test_blacklisted_ip_range_direct(self) -> None:
485
485
Blacklisted IP ranges, accessed directly, are not spidered.
486
486
"""
487
487
channel = self .make_request (
488
- "GET" , "preview_url?url=http://1.1.1.2" , shorthand = False
488
+ "GET" , "v3/ preview_url?url=http://1.1.1.2" , shorthand = False
489
489
)
490
490
491
491
self .assertEqual (channel .code , 403 )
@@ -506,7 +506,7 @@ def test_blacklisted_ip_range_whitelisted_ip(self) -> None:
506
506
507
507
channel = self .make_request (
508
508
"GET" ,
509
- "preview_url?url=http://example.com" ,
509
+ "v3/ preview_url?url=http://example.com" ,
510
510
shorthand = False ,
511
511
await_result = False ,
512
512
)
@@ -542,7 +542,7 @@ def test_blacklisted_ip_with_external_ip(self) -> None:
542
542
]
543
543
544
544
channel = self .make_request (
545
- "GET" , "preview_url?url=http://example.com" , shorthand = False
545
+ "GET" , "v3/ preview_url?url=http://example.com" , shorthand = False
546
546
)
547
547
self .assertEqual (channel .code , 502 )
548
548
self .assertEqual (
@@ -562,7 +562,7 @@ def test_blacklisted_ipv6_specific(self) -> None:
562
562
]
563
563
564
564
channel = self .make_request (
565
- "GET" , "preview_url?url=http://example.com" , shorthand = False
565
+ "GET" , "v3/ preview_url?url=http://example.com" , shorthand = False
566
566
)
567
567
568
568
# No requests made.
@@ -583,7 +583,7 @@ def test_blacklisted_ipv6_range(self) -> None:
583
583
self .lookups ["example.com" ] = [(IPv6Address , "2001:800::1" )]
584
584
585
585
channel = self .make_request (
586
- "GET" , "preview_url?url=http://example.com" , shorthand = False
586
+ "GET" , "v3/ preview_url?url=http://example.com" , shorthand = False
587
587
)
588
588
589
589
self .assertEqual (channel .code , 502 )
@@ -600,7 +600,7 @@ def test_OPTIONS(self) -> None:
600
600
OPTIONS returns the OPTIONS.
601
601
"""
602
602
channel = self .make_request (
603
- "OPTIONS" , "preview_url?url=http://example.com" , shorthand = False
603
+ "OPTIONS" , "v3/ preview_url?url=http://example.com" , shorthand = False
604
604
)
605
605
self .assertEqual (channel .code , 200 )
606
606
self .assertEqual (channel .json_body , {})
@@ -614,7 +614,7 @@ def test_accept_language_config_option(self) -> None:
614
614
# Build and make a request to the server
615
615
channel = self .make_request (
616
616
"GET" ,
617
- "preview_url?url=http://example.com" ,
617
+ "v3/ preview_url?url=http://example.com" ,
618
618
shorthand = False ,
619
619
await_result = False ,
620
620
)
@@ -672,7 +672,7 @@ def test_data_url(self) -> None:
672
672
673
673
channel = self .make_request (
674
674
"GET" ,
675
- f"preview_url?{ query_params } " ,
675
+ f"v3/ preview_url?{ query_params } " ,
676
676
shorthand = False ,
677
677
)
678
678
self .pump ()
@@ -693,7 +693,7 @@ def test_inline_data_url(self) -> None:
693
693
694
694
channel = self .make_request (
695
695
"GET" ,
696
- "preview_url?url=http://matrix.org" ,
696
+ "v3/ preview_url?url=http://matrix.org" ,
697
697
shorthand = False ,
698
698
await_result = False ,
699
699
)
@@ -730,7 +730,7 @@ def test_oembed_photo(self) -> None:
730
730
731
731
channel = self .make_request (
732
732
"GET" ,
733
- "preview_url?url=http://twitter.com/matrixdotorg/status/12345" ,
733
+ "v3/ preview_url?url=http://twitter.com/matrixdotorg/status/12345" ,
734
734
shorthand = False ,
735
735
await_result = False ,
736
736
)
@@ -790,7 +790,7 @@ def test_oembed_rich(self) -> None:
790
790
791
791
channel = self .make_request (
792
792
"GET" ,
793
- "preview_url?url=http://twitter.com/matrixdotorg/status/12345" ,
793
+ "v3/ preview_url?url=http://twitter.com/matrixdotorg/status/12345" ,
794
794
shorthand = False ,
795
795
await_result = False ,
796
796
)
@@ -834,7 +834,7 @@ def test_oembed_format(self) -> None:
834
834
835
835
channel = self .make_request (
836
836
"GET" ,
837
- "preview_url?url=http://www.hulu.com/watch/12345" ,
837
+ "v3/ preview_url?url=http://www.hulu.com/watch/12345" ,
838
838
shorthand = False ,
839
839
await_result = False ,
840
840
)
@@ -892,7 +892,7 @@ def test_oembed_autodiscovery(self) -> None:
892
892
893
893
channel = self .make_request (
894
894
"GET" ,
895
- "preview_url?url=http://www.twitter.com/matrixdotorg/status/12345" ,
895
+ "v3/ preview_url?url=http://www.twitter.com/matrixdotorg/status/12345" ,
896
896
shorthand = False ,
897
897
await_result = False ,
898
898
)
@@ -975,7 +975,7 @@ def _download_image(self) -> Tuple[str, str]:
975
975
976
976
channel = self .make_request (
977
977
"GET" ,
978
- "preview_url?url=http://cdn.twitter.com/matrixdotorg" ,
978
+ "v3/ preview_url?url=http://cdn.twitter.com/matrixdotorg" ,
979
979
shorthand = False ,
980
980
await_result = False ,
981
981
)
@@ -1017,7 +1017,7 @@ def test_storage_providers_exclude_files(self) -> None:
1017
1017
# Check fetching
1018
1018
channel = self .make_request (
1019
1019
"GET" ,
1020
- f"download/{ host } /{ media_id } " ,
1020
+ f"v3/ download/{ host } /{ media_id } " ,
1021
1021
shorthand = False ,
1022
1022
await_result = False ,
1023
1023
)
@@ -1030,7 +1030,7 @@ def test_storage_providers_exclude_files(self) -> None:
1030
1030
1031
1031
channel = self .make_request (
1032
1032
"GET" ,
1033
- f"download/{ host } /{ media_id } " ,
1033
+ f"v3/ download/{ host } /{ media_id } " ,
1034
1034
shorthand = False ,
1035
1035
await_result = False ,
1036
1036
)
@@ -1065,7 +1065,7 @@ def test_storage_providers_exclude_thumbnails(self) -> None:
1065
1065
# Check fetching
1066
1066
channel = self .make_request (
1067
1067
"GET" ,
1068
- f"thumbnail/{ host } /{ media_id } ?width=32&height=32&method=scale" ,
1068
+ f"v3/ thumbnail/{ host } /{ media_id } ?width=32&height=32&method=scale" ,
1069
1069
shorthand = False ,
1070
1070
await_result = False ,
1071
1071
)
@@ -1083,7 +1083,7 @@ def test_storage_providers_exclude_thumbnails(self) -> None:
1083
1083
1084
1084
channel = self .make_request (
1085
1085
"GET" ,
1086
- f"thumbnail/{ host } /{ media_id } ?width=32&height=32&method=scale" ,
1086
+ f"v3/ thumbnail/{ host } /{ media_id } ?width=32&height=32&method=scale" ,
1087
1087
shorthand = False ,
1088
1088
await_result = False ,
1089
1089
)
@@ -1135,7 +1135,7 @@ def test_blacklist_port(self) -> None:
1135
1135
1136
1136
channel = self .make_request (
1137
1137
"GET" ,
1138
- "preview_url?url=" + bad_url ,
1138
+ "v3/ preview_url?url=" + bad_url ,
1139
1139
shorthand = False ,
1140
1140
await_result = False ,
1141
1141
)
@@ -1144,7 +1144,7 @@ def test_blacklist_port(self) -> None:
1144
1144
1145
1145
channel = self .make_request (
1146
1146
"GET" ,
1147
- "preview_url?url=" + good_url ,
1147
+ "v3/ preview_url?url=" + good_url ,
1148
1148
shorthand = False ,
1149
1149
await_result = False ,
1150
1150
)
0 commit comments