1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-09 03:53:26 +00:00

1. Fixed bug with Authenticode URI parsing

2. Fixed bug with Http Uri parsing
This commit is contained in:
Bryan Roe
2022-01-31 18:42:40 -08:00
parent 9ecb0ad760
commit 2a39934cee
3 changed files with 29 additions and 5 deletions

View File

@@ -3913,7 +3913,7 @@ duk_ret_t ILibDuktape_httpStream_parseUri(duk_context *ctx)
char *path, *addr;
unsigned short port;
int protocolIndex;
int protocolIndex, i;
char *username = NULL;
char *password = NULL;
@@ -3980,6 +3980,16 @@ duk_ret_t ILibDuktape_httpStream_parseUri(duk_context *ctx)
duk_push_null(ctx);
}
password = NULL;
// [options]
uri = Duktape_GetStringPropertyValueEx(ctx, -1, "host", NULL, &uriLen);
if ((i = ILibString_IndexOf(uri, uriLen, "?", 1)) >= 0)
{
duk_push_sprintf(ctx, "/%s", uri + i); // [options][newpath]
duk_put_prop_string(ctx, -2, "path"); // [options]
duk_push_lstring(ctx, uri, i); // [options][newhost]
duk_put_prop_string(ctx, -2, "host"); // [options]
}
return 1;
}

File diff suppressed because one or more lines are too long