Remove path escaping from LaunchBrowser (#584)

This is so you can have `?query=args`.
This commit is contained in:
Paul Kulchenko 2022-08-31 22:14:06 -07:00 committed by GitHub
parent d213a48190
commit 33b5b5b312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -672,7 +672,9 @@ FUNCTIONS
LaunchBrowser([path:str])
Launches web browser on local machine with URL to this redbean
server. This function may be called from your /.init.lua.
server. It is the responsibility of the caller to escape the path
with EscapePath if needed, as it's not escaped automatically.
This function may be called from /.init.lua.
CategorizeIp(ip:uint32) → str
Returns a string describing an IP address. This is currently Class

View file

@ -2767,8 +2767,7 @@ static void LaunchBrowser(const char *path) {
if (*path != '/') path = gc(xasprintf("/%s", path));
if ((prog = commandv(GetSystemUrlLauncherCommand(), gc(malloc(PATH_MAX)),
PATH_MAX))) {
u = gc(xasprintf("http://%s:%d%s", inet_ntoa(addr), port,
gc(EscapePath(path, -1, 0))));
u = gc(xasprintf("http://%s:%d%s", inet_ntoa(addr), port, path));
DEBUGF("(srvr) opening browser with command %`'s %s", prog, u);
ignore.sa_flags = 0;
ignore.sa_handler = SIG_IGN;