ported SOURCE management from 2.0.5

This commit is contained in:
Unbit
2014-05-07 06:08:49 +02:00
parent cf8580775a
commit da335692a0
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -44,6 +44,7 @@ struct uwsgi_http {
int headers_timeout;
int connect_timeout;
int manage_source;
};
struct http_session {
+3 -1
View File
@@ -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++;