swarm/api/http: sticky footer for error pages and fix for multiple choices

This commit is contained in:
Janos Guljas 2018-06-19 15:53:18 +02:00 committed by Anton Evangelatov
parent e0450b9b4d
commit c9b3f9e675
2 changed files with 73 additions and 67 deletions

View file

@ -147,6 +147,14 @@ func Respond(w http.ResponseWriter, req *Request, msg string, code int) {
switch code { switch code {
case http.StatusInternalServerError: case http.StatusInternalServerError:
log.Output(msg, log.LvlError, l.CallDepth, "ruid", req.ruid, "code", code) log.Output(msg, log.LvlError, l.CallDepth, "ruid", req.ruid, "code", code)
case http.StatusMultipleChoices:
log.Output(msg, log.LvlDebug, l.CallDepth, "ruid", req.ruid, "code", code)
listURI := api.URI{
Scheme: "bzz-list",
Addr: req.uri.Addr,
Path: req.uri.Path,
}
additionalMessage = fmt.Sprintf(`<a href="/%s">multiple choices</a>`, listURI.String())
default: default:
log.Output(msg, log.LvlDebug, l.CallDepth, "ruid", req.ruid, "code", code) log.Output(msg, log.LvlDebug, l.CallDepth, "ruid", req.ruid, "code", code)
} }

File diff suppressed because one or more lines are too long