Skip to content

Instantly share code, notes, and snippets.

@kazeburo
Created December 10, 2012 07:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kazeburo/4249061 to your computer and use it in GitHub Desktop.
diff -ur httpd-2.2.22.orig/include/httpd.h httpd-2.2.22/include/httpd.h
--- httpd-2.2.22.orig/include/httpd.h 2011-05-19 11:17:37.000000000 +0900
+++ httpd-2.2.22/include/httpd.h 2012-12-10 16:19:36.000000000 +0900
@@ -526,6 +526,7 @@
#define HTTP_LOCKED 423
#define HTTP_FAILED_DEPENDENCY 424
#define HTTP_UPGRADE_REQUIRED 426
+#define HTTP_TOO_MANY_REQUESTS 429
#define HTTP_INTERNAL_SERVER_ERROR 500
#define HTTP_NOT_IMPLEMENTED 501
#define HTTP_BAD_GATEWAY 502
diff -ur httpd-2.2.22.orig/modules/http/http_protocol.c httpd-2.2.22/modules/http/http_protocol.c
--- httpd-2.2.22.orig/modules/http/http_protocol.c 2011-09-09 00:59:38.000000000 +0900
+++ httpd-2.2.22/modules/http/http_protocol.c 2012-12-10 16:29:30.000000000 +0900
@@ -127,7 +127,10 @@
*/
"425 No code",
"426 Upgrade Required",
-#define LEVEL_500 46
+ "427 unused",
+ "428 unused",
+ "429 Too Many Requests",
+#define LEVEL_500 49
"500 Internal Server Error",
"501 Method Not Implemented",
"502 Bad Gateway",
@@ -1063,6 +1066,8 @@
case HTTP_NOT_EXTENDED:
return("<p>A mandatory extension policy in the request is not\n"
"accepted by the server for this resource.</p>\n");
+ case HTTP_TOO_MANY_REQUESTS:
+ return("<p>You sent too many requests.</p>\n");
default: /* HTTP_INTERNAL_SERVER_ERROR */
/*
* This comparison to expose error-notes could be modified to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment