class CGI

Public Class Methods

initialize_without_offline_prompt(*args) click to toggle source

Lets satisfy cgi-offline prompt, even if request does not have REQUEST_METHOD. (It must be mostly for test purpose). See ruby-doc.org/stdlib-2.3.1/libdoc/cgi/rdoc/CGI.html#method-c-new

# File lib/sbsm/cgi.rb, line 33
def self.initialize_without_offline_prompt(*args)
  cgi_input = true
  unless ENV.has_key?('REQUEST_METHOD')
    cgi_input = false
    ENV['REQUEST_METHOD'] = 'GET'
  end
  cgi = CGI.new(*args)
  unless cgi_input
    ENV.delete('REQUEST_METHOD')
  end
  cgi
end