[uri] names of params must be separated with '='

Signed-off-by: Christian Nilsson <nikize@gmail.com>
pull/448/head
Christian Nilsson 2021-08-21 23:49:37 +02:00
parent e09e1142a3
commit ff44ab74a2
2 changed files with 14 additions and 1 deletions

View File

@ -317,7 +317,7 @@ struct uri * parse_uri ( const char *uri_string ) {
if ( ( tmp = strstr ( raw, "##params" ) ) ) {
*tmp = '\0';
tmp += 8 /* "##params" */;
params = find_parameters ( *tmp ? ( tmp + 1 ) : NULL );
params = find_parameters ( *tmp == '=' ? ( tmp + 1 ) : NULL );
if ( params ) {
uri->params = claim_parameters ( params );
} else {

View File

@ -907,6 +907,18 @@ static struct uri_params_test uri_named_params = {
uri_named_params_list,
};
/** Invalid named form parameter URI test */
static struct uri_params_test uri_invalid_named_params = {
"http://boot.ipxe.org/register##paramsXfoo",
{
.scheme = "http",
.host = "boot.ipxe.org",
.path = "/register",
},
NULL,
uri_named_params_list,
};
/**
* Perform URI self-test
*
@ -962,6 +974,7 @@ static void uri_test_exec ( void ) {
/* Form parameter URI tests */
uri_params_ok ( &uri_params );
uri_params_ok ( &uri_named_params );
uri_params_ok ( &uri_invalid_named_params );
}
/** URI self-test */