1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-21 02:33:24 +00:00

Added username/password parsing ability to http.parseUri()

This commit is contained in:
Bryan Roe
2020-06-05 18:58:33 -07:00
parent 2e273bd4b6
commit 432c0d2585
3 changed files with 46 additions and 1 deletions

View File

@@ -219,6 +219,21 @@ void *Duktape_GetPointerProperty(duk_context *ctx, duk_idx_t i, char* propertyNa
return retVal;
}
char* Duktape_GetStringPropertyIndexValueEx(duk_context *ctx, duk_idx_t i, duk_uarridx_t x, char* defaultValue, duk_size_t *len)
{
char *retVal = defaultValue;
if (ctx != NULL && duk_has_prop_index(ctx, i, x))
{
duk_get_prop_index(ctx, i, x);
retVal = (char*)duk_get_lstring(ctx, -1, len);
duk_pop(ctx);
}
else
{
if (len != NULL) { *len = (defaultValue == NULL) ? 0 : strnlen_s(defaultValue, sizeof(ILibScratchPad)); }
}
return retVal;
}
char* Duktape_GetStringPropertyValueEx(duk_context *ctx, duk_idx_t i, char* propertyName, char* defaultValue, duk_size_t *len)
{
char *retVal = defaultValue;