Update Http mixin for opts[:ssl]
1. Add opts[:ssl] 2. Remove opts[:busybox] 3. Refactor logic 4. Remove resource_uribug/bundler_fix
parent
34d358b8d7
commit
0321000ea7
|
@ -15,28 +15,17 @@ module Http
|
|||
end
|
||||
|
||||
def start_service(opts = {})
|
||||
if opts[:busybox] && (ssl = datastore['SSL'])
|
||||
datastore['SSL'] = false
|
||||
end
|
||||
datastore_ssl = datastore['SSL']
|
||||
datastore['SSL'] = !!opts[:ssl]
|
||||
|
||||
super
|
||||
payload_uri = get_uri
|
||||
|
||||
if ssl
|
||||
datastore['SSL'] = true
|
||||
end
|
||||
payload_uri = get_uri
|
||||
datastore['SSL'] = datastore_ssl
|
||||
|
||||
payload_uri
|
||||
end
|
||||
|
||||
def resource_uri
|
||||
if (datastore['URIPATH'] || '').end_with?(?/)
|
||||
random_uri
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def on_request_uri(cli, request)
|
||||
if request['User-Agent'] =~ /^(?:Wget|curl)/
|
||||
send_response(cli, exe)
|
||||
|
|
Loading…
Reference in New Issue