30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/aikido/zen/sinks/httpx.rb', line 30
def send_request(request, *)
wrapped_request = Extensions.wrap_request(request)
if (context = Aikido::Zen.current_context)
prev_request = context["ssrf.request"]
context["ssrf.request"] = wrapped_request
end
SINK.scan(
connection: Aikido::Zen::OutboundConnection.from_uri(request.uri),
request: wrapped_request,
operation: "request"
)
request.on(:response) do |response|
Aikido::Zen::Scanners::SSRFScanner.track_redirects(
request: wrapped_request,
response: Extensions.wrap_response(response)
)
end
super
ensure
context["ssrf.request"] = prev_request if context
end
|