Skip to content

Commit

Permalink
- fix for Fix #266
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuoyd committed May 30, 2007
1 parent e9fa46e commit 9c4c73a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
13 changes: 6 additions & 7 deletions libhttpd/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,8 @@ int httpdReadRequest(httpd *server, request *r)


#if 0
/* XXX: For WifiDog, we do not need to process any of the
post or query string parameters. So, lets keep the GET variables
in the request.path too!
/* XXX: For WifiDog, we only process the query string parameters
but keep the GET variables in the request.query!
*/
/*
** Process and POST data
Expand All @@ -587,18 +586,18 @@ int httpdReadRequest(httpd *server, request *r)
_httpd_storeData(r, buf);

}

#endif

/*
** Process any URL data
*/
cp = index(r->request.path,'?');
if (cp != NULL)
{
*cp = 0;
cp++;
*cp++ = 0;
strncpy(r->request.query, cp, sizeof(r->request.query));
_httpd_storeData(r, cp);
}
#endif

return(0);
}
Expand Down
1 change: 1 addition & 0 deletions libhttpd/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ typedef struct {
contentLength,
authLength;
char path[HTTP_MAX_URL],
query[HTTP_MAX_URL],
host[HTTP_MAX_URL], /* [email protected]/wifidog: Added decoding
of host: header if present. */
ifModified[HTTP_MAX_URL];
Expand Down
8 changes: 5 additions & 3 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ http_callback_404(httpd *webserver, request *r)
* http request to a standard port. At any rate, this handler is called only
* if the internet/auth server is down so it's not a huge loss, but still.
*/
snprintf(tmp_url, (sizeof(tmp_url) - 1), "http://%s%s",
r->request.host,
r->request.path);
snprintf(tmp_url, (sizeof(tmp_url) - 1), "http://%s%s%s%s",
r->request.host,
r->request.path,
r->request.query[0] ? "?" : "",
r->request.query);
url = httpdUrlEncode(tmp_url);

if (!is_online()) {
Expand Down

0 comments on commit 9c4c73a

Please sign in to comment.