@@ -141,13 +141,15 @@ def test_html_action(self):
141
141
142
142
def test_html_action_http2 (self ):
143
143
status , headers , body , _ = self .run_with_ua ('block_html' ,
144
- 'application/json' , http_version = 2 )
144
+ 'application/json' ,
145
+ http_version = 2 )
145
146
self .assertEqual (status , 403 )
146
147
self .assertEqual (headers ['content-type' ], 'text/html;charset=utf-8' )
147
148
148
149
def test_html_action_http3 (self ):
149
150
status , headers , body , _ = self .run_with_ua ('block_html' ,
150
- 'application/json' , http_version = 3 )
151
+ 'application/json' ,
152
+ http_version = 3 )
151
153
self .assertEqual (status , 403 )
152
154
self .assertEqual (headers ['content-type' ], 'text/html;charset=utf-8' )
153
155
@@ -167,12 +169,16 @@ def test_redirect_action(self):
167
169
self .assertEqual (headers ['location' ], 'https://www.cloudflare.com' )
168
170
169
171
def test_redirect_action_http2 (self ):
170
- status , headers , _ , _ = self .run_with_ua ('redirect' , '*/*' , http_version = 2 )
172
+ status , headers , _ , _ = self .run_with_ua ('redirect' ,
173
+ '*/*' ,
174
+ http_version = 2 )
171
175
self .assertEqual (status , 301 )
172
176
self .assertEqual (headers ['location' ], 'https://www.cloudflare.com' )
173
177
174
178
def test_redirect_action_http3 (self ):
175
- status , headers , _ , _ = self .run_with_ua ('redirect' , '*/*' , http_version = 3 )
179
+ status , headers , _ , _ = self .run_with_ua ('redirect' ,
180
+ '*/*' ,
181
+ http_version = 3 )
176
182
self .assertEqual (status , 301 )
177
183
self .assertEqual (headers ['location' ], 'https://www.cloudflare.com' )
178
184
@@ -197,14 +203,16 @@ def test_block_body_json_long(self):
197
203
def test_block_body_json_long_http2 (self ):
198
204
status , _ , _ , log_lines = self .run_with_body (
199
205
'application/json' ,
200
- '{"a": "block_default", "b": "' + ('a' * 1024 * 1024 ), http_version = 2 )
206
+ '{"a": "block_default", "b": "' + ('a' * 1024 * 1024 ),
207
+ http_version = 2 )
201
208
self .assertEqual (status , 403 )
202
209
self .assert_has_report (log_lines )
203
210
204
211
def test_block_body_json_long_http3 (self ):
205
212
status , _ , _ , log_lines = self .run_with_body (
206
213
'application/json' ,
207
- '{"a": "block_default", "b": "' + ('a' * 1024 * 1024 ), http_version = 3 )
214
+ '{"a": "block_default", "b": "' + ('a' * 1024 * 1024 ),
215
+ http_version = 3 )
208
216
self .assertEqual (status , 403 )
209
217
self .assert_has_report (log_lines )
210
218
@@ -232,7 +240,6 @@ def test_block_on_status_http2(self):
232
240
def test_block_on_status_http3 (self ):
233
241
self .block_on_status (3 )
234
242
235
-
236
243
def block_on_status_redirect (self , http_version ):
237
244
if http_version != 3 :
238
245
status , headers , body = self .orch .send_nginx_http_request (
0 commit comments