mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Escape LaunchBrowser path
This also fix a bug where CTRL-C'ing redbean on Linux would kill the browser process. It furthermore fixes a regression with the APE self repair process that happened in a recent change. See #158
This commit is contained in:
parent
6215c91e90
commit
2d34819779
2 changed files with 64 additions and 25 deletions
|
@ -1,7 +1,10 @@
|
|||
-- /.init.lua is loaded at startup in redbean's main process
|
||||
|
||||
HidePath('/usr/share/zoneinfo/')
|
||||
|
||||
-- open a browser tab using explorer/open/xdg-open
|
||||
-- LaunchBrowser('/tool/net/demo/index.html')
|
||||
|
||||
-- this intercepts all requests if it's defined
|
||||
function OnHttpRequest()
|
||||
if HasParam('magic') then
|
||||
Write('<p>\r\n')
|
||||
|
@ -11,7 +14,7 @@ function OnHttpRequest()
|
|||
Write(EscapeHtml(LoadAsset('/.init.lua')))
|
||||
Write('</pre>\r\n')
|
||||
else
|
||||
Route()
|
||||
Route() -- this asks redbean to do the default thing
|
||||
end
|
||||
SetHeader('Server', 'redbean!')
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue