Added statusinfo for HTTP 429.
[wrw.git] / wrw / proto.py
index 4fd26a0..a30b8bf 100644 (file)
@@ -6,6 +6,7 @@ statusinfo = {
     403: ("Forbidden", "You are not authorized to request the requested resource."),
     404: ("Not Found", "The requested resource was not found."),
     405: ("Method Not Allowed", "The request method is not recognized or permitted by the requested resource."),
+    429: ("Too Many Requests", "Your client is sending more frequent requests than are accepted."),
     500: ("Server Error", "An internal error occurred."),
     501: ("Not Implemented", "The requested functionality has not been implemented."),
     503: ("Service Unavailable", "Service is being denied at this time."),
@@ -106,7 +107,7 @@ def urlq(url):
     if isinstance(url, str):
         url = url.encode("utf-8")
     ret = ""
-    invalid = b"%;&=#?/\"'"
+    invalid = b"%;&=+#?/\"'"
     for c in url:
         if c in invalid or (c <= 32) or (c >= 128):
             ret += "%%%02X" % c