diff options
author | Casey Deccio <casey@deccio.net> | 2016-08-26 16:42:28 +0300 |
---|---|---|
committer | Casey Deccio <casey@deccio.net> | 2016-08-26 16:42:28 +0300 |
commit | b9e8cb93d451baf98f45db95be77e28c91110f28 (patch) | |
tree | ef80c8c9c8ec5b6d9ec731b8777364b0949aa2f8 | |
parent | 95eccbdfba0edf648e7756b31be1ee08d9587a79 (diff) |
Allow script to be run from command line
-rwxr-xr-x | contrib/dnsviz-lg.cgi | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/dnsviz-lg.cgi b/contrib/dnsviz-lg.cgi index e9984c7..9d2b7b9 100755 --- a/contrib/dnsviz-lg.cgi +++ b/contrib/dnsviz-lg.cgi @@ -161,8 +161,10 @@ def check_qname(msg): def main(): try: - if os.environ.get('REQUEST_METHOD', '') != 'POST': - raise RemoteQueryError('Request method %s not supported' % os.environ.get('REQUEST_METHOD')) + if not os.environ.get('REQUEST_METHOD', None): + os.environ['REQUEST_METHOD'] = 'POST' + if os.environ['REQUEST_METHOD'] != 'POST': + raise RemoteQueryError('Request method %s not supported' % os.environ['REQUEST_METHOD']) form = cgi.FieldStorage() response_queue = queue.Queue() |