pull/448/merge
Christian I. Nilsson 2025-03-31 23:09:45 -05:00 committed by GitHub
commit 5e250390aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

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

View File

@ -967,6 +967,18 @@ static struct uri_params_test uri_named_params = {
uri_named_params_list, 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 * Perform URI self-test
* *
@ -1026,6 +1038,7 @@ static void uri_test_exec ( void ) {
/* Request parameter URI tests */ /* Request parameter URI tests */
uri_params_ok ( &uri_params ); uri_params_ok ( &uri_params );
uri_params_ok ( &uri_named_params ); uri_params_ok ( &uri_named_params );
uri_params_ok ( &uri_invalid_named_params );
} }
/** URI self-test */ /** URI self-test */