Include the http_decode function from trunk

to replace the + with a space.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@133804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Brandon Kruse 18 years ago
parent 954533dab7
commit 1dc7b64454

@ -571,6 +571,23 @@ static struct ast_str *handle_post(struct ast_tcptls_session_instance *ser, char
} }
#endif /* ENABLE_UPLOADS */ #endif /* ENABLE_UPLOADS */
/*
* Decode special characters in http uri.
* We have ast_uri_decode to handle %XX sequences, but spaces
* are encoded as a '+' so we need to replace them beforehand.
*/
static void http_decode(char *s)
{
char *t;
for (t = s; *t; t++) {
if (*t == '+')
*t = ' ';
}
ast_uri_decode(s);
}
static struct ast_str *handle_uri(struct ast_tcptls_session_instance *ser, char *uri, int *status, static struct ast_str *handle_uri(struct ast_tcptls_session_instance *ser, char *uri, int *status,
char **title, int *contentlength, struct ast_variable **cookies, char **title, int *contentlength, struct ast_variable **cookies,
unsigned int *static_content) unsigned int *static_content)
@ -591,10 +608,10 @@ static struct ast_str *handle_uri(struct ast_tcptls_session_instance *ser, char
while ((val = strsep(&params, "&"))) { while ((val = strsep(&params, "&"))) {
var = strsep(&val, "="); var = strsep(&val, "=");
if (val) if (val)
ast_uri_decode(val); http_decode(val);
else else
val = ""; val = "";
ast_uri_decode(var); http_decode(var);
if ((v = ast_variable_new(var, val, ""))) { if ((v = ast_variable_new(var, val, ""))) {
if (vars) if (vars)
prev->next = v; prev->next = v;
@ -614,7 +631,7 @@ static struct ast_str *handle_uri(struct ast_tcptls_session_instance *ser, char
else else
vars = *cookies; vars = *cookies;
*cookies = NULL; *cookies = NULL;
ast_uri_decode(uri); http_decode(uri);
AST_RWLIST_RDLOCK(&uri_redirects); AST_RWLIST_RDLOCK(&uri_redirects);
AST_RWLIST_TRAVERSE(&uri_redirects, redirect, entry) { AST_RWLIST_TRAVERSE(&uri_redirects, redirect, entry) {

Loading…
Cancel
Save