gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

2ecca430b1beaa8f62e69ea625cfc37b295f729c - Matthew Ernisse - 1598914931

whoops.

view tree

view raw

diff --git a/cgi-bin/rfc b/cgi-bin/rfc
index c2d382a..47d989e 100755
--- a/cgi-bin/rfc
+++ b/cgi-bin/rfc
@@ -9,17 +9,15 @@ def check_requested_path():
 	''' Molly Brown sends us the rest of the requested url on stdin, so
 	read that and check to make sure it is a request for an RFC.
 	'''
-	stdin = sys.stdin.read(1026)
-	stdin = stdin.strip()
+	rfc = os.environ.get('PATH_INFO')
+	if not rfc:
+		raise ValueError('No RFC requested.')
 
-	if len(stdin) > 1024:
-		raise ValueError('URL longer than 1024 bytes.')
-
-	matches = re.search(r'^rfc\d+\.txt', stdin)
+	matches = re.search(r'^rfc\d+\.txt', rfc)
 	if not matches:
 		raise ValueError('Request must be a RFC text file.')
 
-	return stdin
+	return rfc
 
 
 def get_rfc(rfc):