13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/aikido/zen/sinks/excon.rb', line 13
def self.build_request(connection, request)
uri = URI(format("%<scheme>s://%<host>s:%<port>i%<path>s", {
scheme: request.fetch(:scheme) { connection[:scheme] },
host: request.fetch(:hostname) { connection[:hostname] },
port: request.fetch(:port) { connection[:port] },
path: request.fetch(:path) { connection[:path] }
}))
uri.query = request.fetch(:query) { connection[:query] }
Scanners::SSRFScanner::Request.new(
verb: request.fetch(:method) { connection[:method] },
uri: uri,
headers: connection[:headers].to_h.merge(request[:headers].to_h)
)
end
|