@@ -269,7 +269,7 @@ func execShellCommand(appConfig Config, shell string, params []string, req *http
269
269
// setupHandlers - setup http handlers
270
270
func setupHandlers (cmdHandlers []command , appConfig Config , cacheTTL raphanus.DB ) ([]command , error ) {
271
271
resultHandlers := []command {}
272
- indexLiHTML := ""
272
+ indexLiHTML := [] string {}
273
273
existsRootPath := false
274
274
275
275
// map[path][http-method]handler
@@ -289,7 +289,7 @@ func setupHandlers(cmdHandlers []command, appConfig Config, cacheTTL raphanus.DB
289
289
if row .httpMethod != "" {
290
290
methodDesc = row .httpMethod + ": "
291
291
}
292
- indexLiHTML += fmt .Sprintf (`<li><a href=".%s">%s%s</a> <span style="color: #888">- %s<span></li>` , path , methodDesc , path , html .EscapeString (cmd ))
292
+ indexLiHTML = append ( indexLiHTML , fmt .Sprintf (`<li><a href=".%s">%s%s</a> <span style="color: #888">- %s<span></li>` , path , methodDesc , path , html .EscapeString (cmd ) ))
293
293
cmdsForLog [path ] = append (cmdsForLog [path ], cmd )
294
294
295
295
handler := mwMethodOnly (getShellHandler (appConfig , shell , params , cacheTTL ), row .httpMethod )
@@ -322,12 +322,12 @@ func setupHandlers(cmdHandlers []command, appConfig Config, cacheTTL raphanus.DB
322
322
},
323
323
})
324
324
325
- indexLiHTML += fmt .Sprintf (`<li><a href=".%s">%s</a></li>` , "/exit" , "/exit" )
325
+ indexLiHTML = append ( indexLiHTML , fmt .Sprintf (`<li><a href=".%s">%s</a></li>` , "/exit" , "/exit" ) )
326
326
}
327
327
328
328
// --------------
329
329
if ! appConfig .noIndex && ! existsRootPath {
330
- indexHTML := fmt .Sprintf (indexTmpl , version , indexLiHTML )
330
+ indexHTML := fmt .Sprintf (indexTmpl , version , strings . Join ( indexLiHTML , " \n " ) )
331
331
resultHandlers = append (resultHandlers , command {
332
332
path : "/" ,
333
333
cmd : "index page" ,
0 commit comments