You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: apple_safari_webarchive_uxss.rb
    path of file: ./repos/metasploit-framework/modules/auxiliary/gather
    
    the code of the file until where you have to start completion: ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.
    
  def on_request_uri(cli, request)
    if request.method =~ /post/i
      data_str = request.body.to_s
      begin
        data = JSON::parse(data_str || '')
        file = record_data(data, cli)
        send_response_html(cli, '')
        print_good "#{data_str.length} chars received and stored to #{file}"
      rescue JSON::ParserError => e # json error, dismiss request & keep crit. server up
        file = record_data(data_str, cli)
        print_error "Invalid JSON stored in #{file}"
        send_response_html(cli, '')
      end