diff --git a/plugins/http/common.h b/plugins/http/common.h index 11667d84..3281b059 100644 --- a/plugins/http/common.h +++ b/plugins/http/common.h @@ -44,6 +44,7 @@ struct uwsgi_http { int headers_timeout; int connect_timeout; + int manage_source; }; struct http_session { diff --git a/plugins/http/http.c b/plugins/http/http.c index 6da2cd85..c7862dce 100644 --- a/plugins/http/http.c +++ b/plugins/http/http.c @@ -62,6 +62,8 @@ struct uwsgi_option http_options[] = { {"http-server-name-as-http-host", required_argument, 0, "force SERVER_NAME to HTTP_HOST", uwsgi_opt_true, &uhttp.server_name_as_http_host, 0}, {"http-headers-timeout", required_argument, 0, "set internal http socket timeout for headers", uwsgi_opt_set_int, &uhttp.headers_timeout, 0}, {"http-connect-timeout", required_argument, 0, "set internal http socket timeout for backend connections", uwsgi_opt_set_int, &uhttp.connect_timeout, 0}, + + {"http-manage-source", optional_argument, 0, "manage the SOURCE HTTP method placing the session in raw mode", uwsgi_opt_true, &uhttp.manage_source, 0}, {0, 0, 0, 0, 0, 0, 0}, }; @@ -206,7 +208,7 @@ int http_headers_parse(struct corerouter_peer *peer) { if (*ptr == ' ') { if (uwsgi_buffer_append_keyval(out, "REQUEST_METHOD", 14, base, ptr - base)) return -1; // on SOURCE METHOD, force raw body - if (!uwsgi_strncmp(base, ptr - base, "SOURCE", 6)) { + if (uhttp.manage_source && !uwsgi_strncmp(base, ptr - base, "SOURCE", 6)) { hr->raw_body = 1; } ptr++;