File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 1
1
import requests
2
2
import subprocess
3
+ from django .http import JsonResponse
3
4
4
5
def func_calls ():
5
6
formats .get_format ()
@@ -8,19 +9,14 @@ def func_calls():
8
9
sessions .SessionRedirectMixin .resolve_redirects ()
9
10
10
11
if __name__ == '__main__' :
11
- session = requests .Session ()
12
- proxies = {
13
- 'http' : 'http://test:pass@localhost:8080' ,
14
- 'https' : 'http://test:pass@localhost:8090' ,
15
- }
16
- url = 'http://example.com' # Replace with a valid URL
17
- req = requests .Request ('GET' , url )
18
- prep = req .prepare ()
19
- session .rebuild_proxies (prep , proxies )
12
+ from django .urls import path
13
+ from django .views .decorators .http import require_http_methods
14
+ from django .http import HttpResponse
20
15
21
- # Introduce a command injection vulnerability
22
- user_input = input ("Enter a command to execute: " )
23
- command = "ping " + user_input
24
- subprocess .call (command , shell = True )
16
+ @require_http_methods (["GET" ])
17
+ def health (request ):
18
+ return HttpResponse ("ok" )
25
19
26
- print ("Command executed!" )
20
+ urlpatterns = [
21
+ path ('health' , health )
22
+ ]
You can’t perform that action at this time.
0 commit comments