[sheepdog] [PATCH 2/4] http: use REQUEST_URI instead of DOCUMENT_URI
MORITA Kazutaka
morita.kazutaka at gmail.com
Thu Nov 14 19:59:44 CET 2013
At Thu, 14 Nov 2013 17:03:52 +0800,
Liu Yuan wrote:
>
> Current code will segfault if we don't specify DOCUMENT_URI in nginx conf file.
> And we should use REQUEST_URI because REQUEST_URI includes the Query String
> (?q=testing...) where DOCUMENT_URI does not. ? is needed for container list
> operation.
>
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
> sheep/http/http.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/sheep/http/http.c b/sheep/http/http.c
> index aaaec18..8532378 100644
> --- a/sheep/http/http.c
> +++ b/sheep/http/http.c
> @@ -163,7 +163,10 @@ static int request_init_operation(struct http_request *req)
> sd_err("invalid content_length %s", p);
> return BAD_REQUEST;
> }
> - req->uri = FCGX_GetParam("DOCUMENT_URI", env);
> + req->uri = FCGX_GetParam("REQUEST_URI", env);
> + if (!req->uri)
> + return BAD_REQUEST;
> +
If we use REQUEST_URI, please parse the result and split the query
string from req->uri. Otherwise, we cannot access to the uri when we
add a query string.
Thanks,
Kazutaka
More information about the sheepdog
mailing list