[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/13: Updated HTTP methods
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/13: Updated HTTP methods |
Date: |
Sat, 30 Oct 2021 19:17:19 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit aed886a2618e68f4ec08ad42ae31d17df1706910
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Oct 30 15:04:41 2021 +0300
Updated HTTP methods
---
contrib/gen_http_methods_insert.sh | 16 ++++---
src/include/microhttpd.h | 92 +++++++++++++++++++-------------------
2 files changed, 57 insertions(+), 51 deletions(-)
diff --git a/contrib/gen_http_methods_insert.sh
b/contrib/gen_http_methods_insert.sh
index 38485848..65076081 100755
--- a/contrib/gen_http_methods_insert.sh
+++ b/contrib/gen_http_methods_insert.sh
@@ -4,7 +4,7 @@
# Generate header insert for HTTP methods
#
-# Copyright (c) 2015-2019 Karlson2k (Evgeny Grin) <k2k@yandex.ru>
+# Copyright (c) 2015-2021 Karlson2k (Evgeny Grin) <k2k@yandex.ru>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
@@ -17,7 +17,7 @@ echo '/**
* @defgroup methods HTTP methods
* HTTP methods (as strings).
* See: http://www.iana.org/assignments/http-methods/http-methods.xml
- * Registry export date: '$(date -u +%Y-%m-%d)'
+ * Registry export date: '"$(date -u +%Y-%m-%d)"'
* @{
*/
@@ -26,7 +26,7 @@ gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
FNR > 1 {
gsub(/^\[|^"\[|\]"$|\]$/, "", $4)
gsub(/\]\[/, "; ", $4)
- if (substr($4, 1, 7) == "RFC7231") {
+ if (substr($4, 1, 26) == "RFC-ietf-httpbis-semantics") {
if ($2 == "yes")
{ safe_m = "Safe. " }
else
@@ -36,7 +36,9 @@ FNR > 1 {
else
{ indem_m = "Not idempotent." }
print "/* " safe_m " " indem_m " " $4 ". */"
- print "#define MHD_HTTP_METHOD_" toupper(gensub(/-/, "_", "g", $1)) "
\""$1"\""
+ mthd = gensub(/\*/, "ASTERISK", "g", $1)
+ mthd = gensub(/[^a-zA-Z0-9_]/, "_", "g", mthd)
+ printf ("%-32s \"%s\"\n", "#define MHD_HTTP_METHOD_" toupper(mthd), $1)
}
}' methods.csv >> header_insert_methods.h && \
echo '
@@ -45,7 +47,7 @@ gawk -e 'BEGIN {FPAT = "([^,]*)|(\"[^\"]+\")"}
FNR > 1 {
gsub(/^\[|^"\[|\]"$|\]$/, "", $4)
gsub(/\]\[/, "; ", $4)
- if (substr($4, 1, 7) != "RFC7231") {
+ if (substr($4, 1, 26) != "RFC-ietf-httpbis-semantics") {
if ($2 == "yes")
{ safe_m = "Safe. " }
else
@@ -55,7 +57,9 @@ FNR > 1 {
else
{ indem_m = "Not idempotent." }
print "/* " safe_m " " indem_m " " $4 ". */"
- print "#define MHD_HTTP_METHOD_" toupper(gensub(/-/, "_", "g", $1)) "
\""$1"\""
+ mthd = gensub(/\*/, "ASTERISK", "g", $1)
+ mthd = gensub(/[^a-zA-Z0-9_]/, "_", "g", mthd)
+ printf ("%-38s \"%s\"\n", "#define MHD_HTTP_METHOD_" toupper(mthd), $1)
}
}' methods.csv >> header_insert_methods.h && \
echo OK && \
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 7fb6e33c..f4b1dda8 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -942,87 +942,89 @@ MHD_get_reason_phrase_len_for (unsigned int code);
* @defgroup methods HTTP methods
* HTTP methods (as strings).
* See: http://www.iana.org/assignments/http-methods/http-methods.xml
- * Registry export date: 2020-09-20
+ * Registry export date: 2021-10-30
* @{
*/
/* Main HTTP methods. */
-/* Not safe. Not idempotent. RFC7231, Section 4.3.6. */
-#define MHD_HTTP_METHOD_CONNECT "CONNECT"
-/* Not safe. Idempotent. RFC7231, Section 4.3.5. */
-#define MHD_HTTP_METHOD_DELETE "DELETE"
-/* Safe. Idempotent. RFC7231, Section 4.3.1. */
-#define MHD_HTTP_METHOD_GET "GET"
-/* Safe. Idempotent. RFC7231, Section 4.3.2. */
-#define MHD_HTTP_METHOD_HEAD "HEAD"
-/* Safe. Idempotent. RFC7231, Section 4.3.7. */
-#define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
-/* Not safe. Not idempotent. RFC7231, Section 4.3.3. */
-#define MHD_HTTP_METHOD_POST "POST"
-/* Not safe. Idempotent. RFC7231, Section 4.3.4. */
-#define MHD_HTTP_METHOD_PUT "PUT"
-/* Safe. Idempotent. RFC7231, Section 4.3.8. */
-#define MHD_HTTP_METHOD_TRACE "TRACE"
+/* Not safe. Not idempotent. RFC-ietf-httpbis-semantics, Section 9.3.6. */
+#define MHD_HTTP_METHOD_CONNECT "CONNECT"
+/* Not safe. Idempotent. RFC-ietf-httpbis-semantics, Section 9.3.5. */
+#define MHD_HTTP_METHOD_DELETE "DELETE"
+/* Safe. Idempotent. RFC-ietf-httpbis-semantics, Section 9.3.1. */
+#define MHD_HTTP_METHOD_GET "GET"
+/* Safe. Idempotent. RFC-ietf-httpbis-semantics, Section 9.3.2. */
+#define MHD_HTTP_METHOD_HEAD "HEAD"
+/* Safe. Idempotent. RFC-ietf-httpbis-semantics, Section 9.3.7. */
+#define MHD_HTTP_METHOD_OPTIONS "OPTIONS"
+/* Not safe. Not idempotent. RFC-ietf-httpbis-semantics, Section 9.3.3. */
+#define MHD_HTTP_METHOD_POST "POST"
+/* Not safe. Idempotent. RFC-ietf-httpbis-semantics, Section 9.3.4. */
+#define MHD_HTTP_METHOD_PUT "PUT"
+/* Safe. Idempotent. RFC-ietf-httpbis-semantics, Section 9.3.8. */
+#define MHD_HTTP_METHOD_TRACE "TRACE"
+/* Not safe. Not idempotent. RFC-ietf-httpbis-semantics, Section 18.2. */
+#define MHD_HTTP_METHOD_ASTERISK "*"
/* Additional HTTP methods. */
/* Not safe. Idempotent. RFC3744, Section 8.1. */
-#define MHD_HTTP_METHOD_ACL "ACL"
+#define MHD_HTTP_METHOD_ACL "ACL"
/* Not safe. Idempotent. RFC3253, Section 12.6. */
#define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL"
/* Not safe. Idempotent. RFC5842, Section 4. */
-#define MHD_HTTP_METHOD_BIND "BIND"
+#define MHD_HTTP_METHOD_BIND "BIND"
/* Not safe. Idempotent. RFC3253, Section 4.4, Section 9.4. */
-#define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
+#define MHD_HTTP_METHOD_CHECKIN "CHECKIN"
/* Not safe. Idempotent. RFC3253, Section 4.3, Section 8.8. */
-#define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
+#define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT"
/* Not safe. Idempotent. RFC4918, Section 9.8. */
-#define MHD_HTTP_METHOD_COPY "COPY"
+#define MHD_HTTP_METHOD_COPY "COPY"
/* Not safe. Idempotent. RFC3253, Section 8.2. */
-#define MHD_HTTP_METHOD_LABEL "LABEL"
+#define MHD_HTTP_METHOD_LABEL "LABEL"
/* Not safe. Idempotent. RFC2068, Section 19.6.1.2. */
-#define MHD_HTTP_METHOD_LINK "LINK"
+#define MHD_HTTP_METHOD_LINK "LINK"
/* Not safe. Not idempotent. RFC4918, Section 9.10. */
-#define MHD_HTTP_METHOD_LOCK "LOCK"
+#define MHD_HTTP_METHOD_LOCK "LOCK"
/* Not safe. Idempotent. RFC3253, Section 11.2. */
-#define MHD_HTTP_METHOD_MERGE "MERGE"
+#define MHD_HTTP_METHOD_MERGE "MERGE"
/* Not safe. Idempotent. RFC3253, Section 13.5. */
-#define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
+#define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY"
/* Not safe. Idempotent. RFC4791, Section 5.3.1; RFC8144, Section 2.3. */
-#define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
+#define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR"
/* Not safe. Idempotent. RFC4918, Section 9.3; RFC5689, Section 3;
RFC8144, Section 2.3. */
-#define MHD_HTTP_METHOD_MKCOL "MKCOL"
+#define MHD_HTTP_METHOD_MKCOL "MKCOL"
/* Not safe. Idempotent. RFC4437, Section 6. */
-#define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
+#define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF"
/* Not safe. Idempotent. RFC3253, Section 6.3. */
-#define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
+#define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE"
/* Not safe. Idempotent. RFC4918, Section 9.9. */
-#define MHD_HTTP_METHOD_MOVE "MOVE"
+#define MHD_HTTP_METHOD_MOVE "MOVE"
/* Not safe. Idempotent. RFC3648, Section 7. */
-#define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
+#define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH"
/* Not safe. Not idempotent. RFC5789, Section 2. */
-#define MHD_HTTP_METHOD_PATCH "PATCH"
+#define MHD_HTTP_METHOD_PATCH "PATCH"
/* Safe. Idempotent. RFC7540, Section 3.5. */
-#define MHD_HTTP_METHOD_PRI "PRI"
+#define MHD_HTTP_METHOD_PRI "PRI"
/* Safe. Idempotent. RFC4918, Section 9.1; RFC8144, Section 2.1. */
-#define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
+#define MHD_HTTP_METHOD_PROPFIND "PROPFIND"
/* Not safe. Idempotent. RFC4918, Section 9.2; RFC8144, Section 2.2. */
-#define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
+#define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH"
/* Not safe. Idempotent. RFC5842, Section 6. */
-#define MHD_HTTP_METHOD_REBIND "REBIND"
+#define MHD_HTTP_METHOD_REBIND "REBIND"
/* Safe. Idempotent. RFC3253, Section 3.6; RFC8144, Section 2.1. */
-#define MHD_HTTP_METHOD_REPORT "REPORT"
+#define MHD_HTTP_METHOD_REPORT "REPORT"
/* Safe. Idempotent. RFC5323, Section 2. */
-#define MHD_HTTP_METHOD_SEARCH "SEARCH"
+#define MHD_HTTP_METHOD_SEARCH "SEARCH"
/* Not safe. Idempotent. RFC5842, Section 5. */
-#define MHD_HTTP_METHOD_UNBIND "UNBIND"
+#define MHD_HTTP_METHOD_UNBIND "UNBIND"
/* Not safe. Idempotent. RFC3253, Section 4.5. */
-#define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
+#define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT"
/* Not safe. Idempotent. RFC2068, Section 19.6.1.3. */
-#define MHD_HTTP_METHOD_UNLINK "UNLINK"
+#define MHD_HTTP_METHOD_UNLINK "UNLINK"
/* Not safe. Idempotent. RFC4918, Section 9.11. */
-#define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
+#define MHD_HTTP_METHOD_UNLOCK "UNLOCK"
/* Not safe. Idempotent. RFC3253, Section 7.1. */
-#define MHD_HTTP_METHOD_UPDATE "UPDATE"
+#define MHD_HTTP_METHOD_UPDATE "UPDATE"
/* Not safe. Idempotent. RFC4437, Section 7. */
#define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF"
/* Not safe. Idempotent. RFC3253, Section 3.5. */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (22300a52 -> 645b0140), gnunet, 2021/10/30
- [libmicrohttpd] 02/13: Updated HTTP methods,
gnunet <=
- [libmicrohttpd] 04/13: microhttpd.h: fixed typo in doxy, gnunet, 2021/10/30
- [libmicrohttpd] 07/13: src/microhttpd/Makefile.am: removed empty lines, gnunet, 2021/10/30
- [libmicrohttpd] 05/13: microhttpd.h: MHD_ResponseFlags comments, gnunet, 2021/10/30
- [libmicrohttpd] 08/13: keepalive_possible(): added TODOs, gnunet, 2021/10/30
- [libmicrohttpd] 03/13: Updated HTTP headers names, gnunet, 2021/10/30
- [libmicrohttpd] 11/13: setup_reply_properties(): improved comments, gnunet, 2021/10/30
- [libmicrohttpd] 01/13: Updated HTTP statuses, gnunet, 2021/10/30
- [libmicrohttpd] 13/13: build_header_response(): added assert, gnunet, 2021/10/30
- [libmicrohttpd] 06/13: Improved doxy for MHD_add_response_header(), gnunet, 2021/10/30
- [libmicrohttpd] 10/13: connection_maximize_write_buffer(): fixed comment, gnunet, 2021/10/30