File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def __call__(self, request):
26
26
return response
27
27
28
28
def is_non_post_redirect (self , request , response ):
29
- return self .is_redirect_request (response ) and request .method in ['POST ' , 'PATCH' , 'DELETE' ]
29
+ return self .is_redirect_request (response ) and request .method in ['PUT ' , 'PATCH' , 'DELETE' ]
30
30
31
31
def is_inertia_request (self , request ):
32
32
return 'X-Inertia' in request .headers
Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ def test_stale_versions_are_refreshed(self):
16
16
self .assertEqual (response .headers ['X-Inertia-Location' ], 'http://testserver/empty/' )
17
17
18
18
def test_redirect_status (self ):
19
- for http_method in ['post' , 'patch' , 'delete' ]:
19
+ response = self .inertia .post ('/redirect/' )
20
+ self .assertEqual (response .status_code , 302 )
21
+
22
+ for http_method in ['put' , 'patch' , 'delete' ]:
20
23
response = getattr (self .inertia , http_method )('/redirect/' )
21
24
22
25
self .assertEqual (response .status_code , 303 )
23
26
24
-
25
27
def test_a_request_not_from_inertia_is_ignored (self ):
26
28
response = self .client .get ('/empty/' ,
27
29
HTTP_X_INERTIA_VERSION = 'some-nonsense' ,
You can’t perform that action at this time.
0 commit comments