Hi,
One of our customers recently asked us to look into adding HTTP PATCH
support to Pound, as they needed it for their application.
There was an email to the mailing list regarding PATCH support last year
from Paul Chvostek (copied in), but there was no reply.
It appears that adding PATCH support is a simple as including "PATCH" in
the appropriate regular expressions in config.c: static char *xhttp[].
I've included a patch against Pound 2.7a
(http://www.apsis.ch/pound/Pound-2.7a.tgz) that implements the
aforementioned changes.
Kind Regards,
Liam Fraser.
--
Mythic Beasts
Author: Liam Fraser <[email protected]>
This patch adds support for the HTTP PATCH Method (RFC5789) to Pound 2.7a
(http://www.apsis.ch/pound/Pound-2.7a.tgz).
diff --git a/config.c b/config.c
index 6ed8e39..3c55e92 100755
--- a/config.c
+++ b/config.c
@@ -86,10 +86,10 @@ static regmatch_t matches[5];
static char *xhttp[] = {
"^(GET|POST|HEAD) ([^ ]+) HTTP/1.[01]$",
- "^(GET|POST|HEAD|PUT|DELETE) ([^ ]+) HTTP/1.[01]$",
- "^(GET|POST|HEAD|PUT|DELETE|LOCK|UNLOCK|PROPFIND|PROPPATCH|SEARCH|MKCOL|MOVE|COPY|OPTIONS|TRACE|MKACTIVITY|CHECKOUT|MERGE|REPORT) ([^ ]+) HTTP/1.[01]$",
- "^(GET|POST|HEAD|PUT|DELETE|LOCK|UNLOCK|PROPFIND|PROPPATCH|SEARCH|MKCOL|MOVE|COPY|OPTIONS|TRACE|MKACTIVITY|CHECKOUT|MERGE|REPORT|SUBSCRIBE|UNSUBSCRIBE|BPROPPATCH|POLL|BMOVE|BCOPY|BDELETE|BPROPFIND|NOTIFY|CONNECT) ([^ ]+) HTTP/1.[01]$",
- "^(GET|POST|HEAD|PUT|DELETE|LOCK|UNLOCK|PROPFIND|PROPPATCH|SEARCH|MKCOL|MOVE|COPY|OPTIONS|TRACE|MKACTIVITY|CHECKOUT|MERGE|REPORT|SUBSCRIBE|UNSUBSCRIBE|BPROPPATCH|POLL|BMOVE|BCOPY|BDELETE|BPROPFIND|NOTIFY|CONNECT|RPC_IN_DATA|RPC_OUT_DATA) ([^ ]+) HTTP/1.[01]$",
+ "^(GET|POST|HEAD|PUT|PATCH|DELETE) ([^ ]+) HTTP/1.[01]$",
+ "^(GET|POST|HEAD|PUT|PATCH|DELETE|LOCK|UNLOCK|PROPFIND|PROPPATCH|SEARCH|MKCOL|MOVE|COPY|OPTIONS|TRACE|MKACTIVITY|CHECKOUT|MERGE|REPORT) ([^ ]+) HTTP/1.[01]$",
+ "^(GET|POST|HEAD|PUT|PATCH|DELETE|LOCK|UNLOCK|PROPFIND|PROPPATCH|SEARCH|MKCOL|MOVE|COPY|OPTIONS|TRACE|MKACTIVITY|CHECKOUT|MERGE|REPORT|SUBSCRIBE|UNSUBSCRIBE|BPROPPATCH|POLL|BMOVE|BCOPY|BDELETE|BPROPFIND|NOTIFY|CONNECT) ([^ ]+) HTTP/1.[01]$",
+ "^(GET|POST|HEAD|PUT|PATCH|DELETE|LOCK|UNLOCK|PROPFIND|PROPPATCH|SEARCH|MKCOL|MOVE|COPY|OPTIONS|TRACE|MKACTIVITY|CHECKOUT|MERGE|REPORT|SUBSCRIBE|UNSUBSCRIBE|BPROPPATCH|POLL|BMOVE|BCOPY|BDELETE|BPROPFIND|NOTIFY|CONNECT|RPC_IN_DATA|RPC_OUT_DATA) ([^ ]+) HTTP/1.[01]$",
};
static int log_level = 1;
diff --git a/pound.8 b/pound.8
index 4c29c2c..e909dff 100755
--- a/pound.8
+++ b/pound.8
@@ -360,7 +360,7 @@ Defines which HTTP verbs are accepted. The possible values are:
(default) accept only standard HTTP requests (GET, POST, HEAD).
.IP
.I 1
-additionally allow extended HTTP requests (PUT, DELETE).
+additionally allow extended HTTP requests (PUT, PATCH, DELETE).
.IP
.I 2
additionally allow standard WebDAV verbs (LOCK, UNLOCK, PROPFIND,