Update Http mixin for opts[:ssl]

1. Add opts[:ssl]
2. Remove opts[:busybox]
3. Refactor logic
4. Remove resource_uri
bug/bundler_fix
William Vu 2016-12-29 18:20:25 -06:00
parent 34d358b8d7
commit 0321000ea7
1 changed files with 4 additions and 15 deletions

View File

@ -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)