33"""
44
55from aikido_zen .helpers .get_argument import get_argument
6- from aikido_zen .sinks import before , after , patch_function , on_import
6+ from aikido_zen .sinks import after , patch_function , on_import
77from aikido_zen .vulnerabilities .ssrf .handle_http_response import (
88 handle_http_response ,
99)
1010from aikido_zen .helpers .try_parse_url import try_parse_url
1111
1212
13- @before
14- def _putrequest (func , instance , args , kwargs ):
15- path = get_argument (args , kwargs , 1 , "path" )
16- setattr (instance , "_aikido_var_path" , path )
17-
18-
1913@after
2014def _getresponse (func , instance , args , kwargs , return_value ):
21- path = getattr ( instance , "_aikido_var_path " )
15+ path = get_argument ( args , kwargs , 1 , "path " )
2216 source_url = try_parse_url (f"http://{ instance .host } :{ instance .port } { path } " )
2317 handle_http_response (http_response = return_value , source = source_url )
2418
@@ -27,8 +21,6 @@ def _getresponse(func, instance, args, kwargs, return_value):
2721def patch (m ):
2822 """
2923 patching module http.client
30- - patches HTTPConnection.putrequest -> stores path
31- - patches HTTPConnection.getresponse -> handles response object
24+ - patches HTTPConnection.getresponse
3225 """
33- patch_function (m , "HTTPConnection.putrequest" , _putrequest )
3426 patch_function (m , "HTTPConnection.getresponse" , _getresponse )
0 commit comments