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 end
def start_service(opts = {}) def start_service(opts = {})
if opts[:busybox] && (ssl = datastore['SSL']) datastore_ssl = datastore['SSL']
datastore['SSL'] = false datastore['SSL'] = !!opts[:ssl]
end
super super
payload_uri = get_uri
if ssl payload_uri = get_uri
datastore['SSL'] = true datastore['SSL'] = datastore_ssl
end
payload_uri payload_uri
end end
def resource_uri
if (datastore['URIPATH'] || '').end_with?(?/)
random_uri
else
super
end
end
def on_request_uri(cli, request) def on_request_uri(cli, request)
if request['User-Agent'] =~ /^(?:Wget|curl)/ if request['User-Agent'] =~ /^(?:Wget|curl)/
send_response(cli, exe) send_response(cli, exe)