tools: ignore URL query string in nfd-status-http-server
Change-Id: I5e071b7f036a0ef4e9a6e8b6a1eaf637aa5ad92e
diff --git a/tools/nfd-status-http-server.py b/tools/nfd-status-http-server.py
index 5f2c891..7284448 100755
--- a/tools/nfd-status-http-server.py
+++ b/tools/nfd-status-http-server.py
@@ -27,15 +27,17 @@
from http.server import HTTPServer, SimpleHTTPRequestHandler
from socketserver import ThreadingMixIn
+from urllib.parse import urlsplit
import argparse, ipaddress, os, socket, subprocess
class NfdStatusHandler(SimpleHTTPRequestHandler):
""" The handler class to handle requests """
def do_GET(self):
- if self.path == "/":
+ path = urlsplit(self.path).path
+ if path == "/":
self.__serveReport()
- elif self.path == "/robots.txt" and self.server.allowRobots:
+ elif path == "/robots.txt" and self.server.allowRobots:
self.send_error(404)
else:
super().do_GET()