summaryrefslogtreecommitdiff
path: root/server_http.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@esdenera.com>2014-07-25 23:06:50 +0200
committerReyk Floeter <reyk@esdenera.com>2014-07-25 23:06:50 +0200
commite30ef12693dc3dcdf72573424c839afb10769b70 (patch)
treec24f3231a41a6b7e13372702217289775210e052 /server_http.c
parente3e992b54315a4d8e9bf446dab17ebde280903e1 (diff)
downloadhttpd-e30ef12693dc3dcdf72573424c839afb10769b70.tar.gz
httpd-e30ef12693dc3dcdf72573424c839afb10769b70.zip
sync
Diffstat (limited to 'server_http.c')
-rw-r--r--server_http.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/server_http.c b/server_http.c
index 98edb96..58080a4 100644
--- a/server_http.c
+++ b/server_http.c
@@ -627,13 +627,19 @@ server_close_http(struct client *clt)
int
server_response(struct httpd *httpd, struct client *clt)
{
+ char path[MAXPATHLEN];
struct http_descriptor *desc = clt->clt_desc;
struct server *srv = clt->clt_srv;
struct server_config *srv_conf;
struct kv *kv, key;
int ret;
- if (desc->http_path == NULL)
+ /* Canonicalize the request path */
+ if (desc->http_path == NULL ||
+ canonicalize_path(desc->http_path, path, sizeof(path)) == NULL)
+ goto fail;
+ free(desc->http_path);
+ if ((desc->http_path = strdup(path)) == NULL)
goto fail;
if (strcmp(desc->http_version, "HTTP/1.1") == 0) {