Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dnsviz/dnsviz.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Deccio <casey@deccio.net>2016-08-26 16:42:28 +0300
committerCasey Deccio <casey@deccio.net>2016-08-26 16:42:28 +0300
commitb9e8cb93d451baf98f45db95be77e28c91110f28 (patch)
treeef80c8c9c8ec5b6d9ec731b8777364b0949aa2f8
parent95eccbdfba0edf648e7756b31be1ee08d9587a79 (diff)
Allow script to be run from command line
-rwxr-xr-xcontrib/dnsviz-lg.cgi6
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()