mirror of
https://github.com/ipxe/ipxe
synced 2025-12-18 02:20:19 +03:00
[settings] Re-add "uristring" setting type
Commit09b057c("[settings] Remove "uristring" setting type") removed support for URI-encoded settings via the "uristring" setting type, on the basis that such encoding was no longer necessary to avoid problems with the command line parser. Other valid use cases for the "uristring" setting type do exist: for example, a password containing a '/' character expanded via chain http://username:${password:uristring}@server.name/boot.php Restore the existence of the "uristring" setting, avoiding the potentially large stack allocations that were used in the old code prior to commit09b057c("[settings] Remove "uristring" setting type"). Requested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1826,7 +1826,7 @@ static size_t http_params ( struct parameters *params, char *buf, size_t len ) {
|
||||
}
|
||||
|
||||
/* URI-encode the key */
|
||||
frag_len = uri_encode ( param->key, 0, buf, remaining );
|
||||
frag_len = uri_encode_string ( 0, param->key, buf, remaining );
|
||||
buf += frag_len;
|
||||
len += frag_len;
|
||||
remaining -= frag_len;
|
||||
@@ -1839,7 +1839,7 @@ static size_t http_params ( struct parameters *params, char *buf, size_t len ) {
|
||||
remaining--;
|
||||
|
||||
/* URI-encode the value */
|
||||
frag_len = uri_encode ( param->value, 0, buf, remaining );
|
||||
frag_len = uri_encode_string ( 0, param->value, buf, remaining);
|
||||
buf += frag_len;
|
||||
len += frag_len;
|
||||
remaining -= frag_len;
|
||||
|
||||
Reference in New Issue
Block a user