1.1 --- a/WebStack/BaseHTTPRequestHandler.py Sun May 30 20:02:49 2004 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Sun May 30 20:32:17 2004 +0000
1.3 @@ -140,6 +140,17 @@
1.4
1.5 return self.trans.path
1.6
1.7 + def get_path_without_query(self):
1.8 +
1.9 + """
1.10 + A framework-specific method which gets the entire path from the request
1.11 + minus the query string.
1.12 + """
1.13 +
1.14 + # Remove the query string from the end of the path.
1.15 +
1.16 + return self.trans.path.split("?")[0]
1.17 +
1.18 def get_path_info(self):
1.19
1.20 """
1.21 @@ -148,9 +159,7 @@
1.22 request.
1.23 """
1.24
1.25 - # Remove the query string from the end of the path.
1.26 -
1.27 - return self.trans.path.split("?")[0]
1.28 + return self.get_path_without_query()
1.29
1.30 def get_query_string(self):
1.31
2.1 --- a/WebStack/CGI.py Sun May 30 20:02:49 2004 +0000
2.2 +++ b/WebStack/CGI.py Sun May 30 20:32:17 2004 +0000
2.3 @@ -143,13 +143,23 @@
2.4 A framework-specific method which gets the entire path from the request.
2.5 """
2.6
2.7 + path = self.get_path_without_query()
2.8 + qs = self.get_query_string()
2.9 + if qs:
2.10 + path += "?"
2.11 + path += qs
2.12 + return path
2.13 +
2.14 + def get_path_without_query(self):
2.15 +
2.16 + """
2.17 + A framework-specific method which gets the entire path from the request
2.18 + minus the query string.
2.19 + """
2.20 +
2.21 path = self.env.get("SCRIPT_NAME") or ""
2.22 if self.env.has_key("PATH_INFO"):
2.23 path += self.env["PATH_INFO"]
2.24 - qs = self.env.get("QUERY_STRING")
2.25 - if qs:
2.26 - path += "?"
2.27 - path += qs
2.28 return path
2.29
2.30 def get_path_info(self):
3.1 --- a/WebStack/Generic.py Sun May 30 20:02:49 2004 +0000
3.2 +++ b/WebStack/Generic.py Sun May 30 20:32:17 2004 +0000
3.3 @@ -195,6 +195,15 @@
3.4
3.5 raise NotImplementedError, "get_path"
3.6
3.7 + def get_path_without_query(self):
3.8 +
3.9 + """
3.10 + A framework-specific method which gets the entire path from the request
3.11 + minus the query string.
3.12 + """
3.13 +
3.14 + raise NotImplementedError, "get_path_without_query"
3.15 +
3.16 def get_path_info(self):
3.17
3.18 """
4.1 --- a/WebStack/JavaServlet.py Sun May 30 20:02:49 2004 +0000
4.2 +++ b/WebStack/JavaServlet.py Sun May 30 20:32:17 2004 +0000
4.3 @@ -167,6 +167,22 @@
4.4 A framework-specific method which gets the entire path from the request.
4.5 """
4.6
4.7 + # NOTE: To be verified.
4.8 +
4.9 + path = self.get_path_without_query()
4.10 + qs = self.get_query_string()
4.11 + if qs:
4.12 + path += "?"
4.13 + path += qs
4.14 + return path
4.15 +
4.16 + def get_path_without_query(self):
4.17 +
4.18 + """
4.19 + A framework-specific method which gets the entire path from the request
4.20 + minus the query string.
4.21 + """
4.22 +
4.23 return self.request.getServletPath()
4.24
4.25 def get_path_info(self):
5.1 --- a/WebStack/ModPython.py Sun May 30 20:02:49 2004 +0000
5.2 +++ b/WebStack/ModPython.py Sun May 30 20:32:17 2004 +0000
5.3 @@ -109,6 +109,15 @@
5.4 else:
5.5 return self.trans.uri
5.6
5.7 + def get_path_without_query(self):
5.8 +
5.9 + """
5.10 + A framework-specific method which gets the entire path from the request
5.11 + minus the query string.
5.12 + """
5.13 +
5.14 + return self.trans.uri
5.15 +
5.16 def get_path_info(self):
5.17
5.18 """
6.1 --- a/WebStack/Twisted.py Sun May 30 20:02:49 2004 +0000
6.2 +++ b/WebStack/Twisted.py Sun May 30 20:32:17 2004 +0000
6.3 @@ -99,6 +99,15 @@
6.4
6.5 return self.trans.uri
6.6
6.7 + def get_path_without_query(self):
6.8 +
6.9 + """
6.10 + A framework-specific method which gets the entire path from the request
6.11 + minus the query string.
6.12 + """
6.13 +
6.14 + return self.get_path().split("?")[0]
6.15 +
6.16 def get_path_info(self):
6.17
6.18 """
7.1 --- a/WebStack/Webware.py Sun May 30 20:02:49 2004 +0000
7.2 +++ b/WebStack/Webware.py Sun May 30 20:32:17 2004 +0000
7.3 @@ -122,6 +122,15 @@
7.4
7.5 return self.trans.request().uri()
7.6
7.7 + def get_path_without_query(self):
7.8 +
7.9 + """
7.10 + A framework-specific method which gets the entire path from the request
7.11 + minus the query string.
7.12 + """
7.13 +
7.14 + return self.get_path().split("?")[0]
7.15 +
7.16 def get_path_info(self):
7.17
7.18 """