Skip to content

Appliance mode + minor fixes

A trivial change to introduce an "appliance mode" (hide history + show warning). This was more an exercise for me to dive a bit into JS ;-)

One issue though: when calling /history, I get a 500 error with the following backtrace:

TypeError [ERR_INVALID_URL]: Invalid URL: 
    at onParseError (internal/url.js:241:17)
    at new URL (internal/url.js:319:5)
    at new URL (internal/url.js:316:22)
    at Object.errorForbidden (/home/hackmd/app/lib/response.js:34:19)
    at historyGet (/home/hackmd/app/lib/history/index.js:126:21)
    at Layer.handle [as handle_request] (/home/hackmd/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/hackmd/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/hackmd/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/hackmd/app/node_modules/express/lib/router/layer.js:95:5)
    at /home/hackmd/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/hackmd/app/node_modules/express/lib/router/index.js:335:12)
    at next (/home/hackmd/app/node_modules/express/lib/router/index.js:275:10)
    at /home/hackmd/app/node_modules/express/lib/router/index.js:635:15
    at next (/home/hackmd/app/node_modules/express/lib/router/index.js:260:14)
    at Function.handle (/home/hackmd/app/node_modules/express/lib/router/index.js:174:3)
    at router (/home/hackmd/app/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/home/hackmd/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/hackmd/app/node_modules/express/lib/router/index.js:317:13)
    at /home/hackmd/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/hackmd/app/node_modules/express/lib/router/index.js:335:12)
    at next (/home/hackmd/app/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/home/hackmd/app/node_modules/express/lib/router/index.js:174:3)

So I appreciate a review of my change - maybe I have to also remove the /history route?

Edited by Giuseppe Lo Presti

Merge request reports