From f91788b809d9726126e9cf4384fedbbb0c5b8a73 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Mon, 17 Aug 2015 15:19:48 +0000 Subject: [PATCH] cgi: Support passing X-HTTP-Method-Override header. As uhttpd doesn't currently support PUT/DELETE/PATCH, allow passing the commonly used X-HTTP-Method-Override header to CGI scripts. This is an optional "protocol specific metadata" variable as per rfc 3875 section 4.1.18. Signed-off-by: Karl Palsson --- proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proc.c b/proc.c index d4f5e3d..4819e08 100644 --- a/proc.c +++ b/proc.c @@ -33,7 +33,8 @@ __header(referer, referer) \ __header(user_agent, user-agent) \ __header(content_type, content-type) \ - __header(content_length, content-length) + __header(content_length, content-length) \ + __header(x_http_method_override, x-http-method-override) #undef __header #define __header __enum_header @@ -62,6 +63,7 @@ static const struct { { "HTTP_HOST", HDR_host }, { "HTTP_REFERER", HDR_referer }, { "HTTP_USER_AGENT", HDR_user_agent }, + { "HTTP_X_HTTP_METHOD_OVERRIDE", HDR_x_http_method_override }, { "CONTENT_TYPE", HDR_content_type }, { "CONTENT_LENGTH", HDR_content_length }, }; -- 2.25.1