WebClient: add a ping URL

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-11-06 19:58:39 +01:00
parent 789d61f170
commit 6295be786f
6 changed files with 35 additions and 5 deletions

View File

@@ -102,6 +102,7 @@ type baseClientPage struct {
SharesURL string
ShareURL string
ProfileURL string
PingURL string
ChangePwdURL string
StaticURL string
LogoutURL string
@@ -540,6 +541,7 @@ func (s *httpdServer) getBaseClientPageData(title, currentURL string, r *http.Re
SharesURL: webClientSharesPath,
ShareURL: webClientSharePath,
ProfileURL: webClientProfilePath,
PingURL: webClientPingPath,
ChangePwdURL: webChangeClientPwdPath,
StaticURL: webStaticFilesPath,
LogoutURL: webClientLogoutPath,
@@ -1792,3 +1794,8 @@ func (s *httpdServer) handleClientShareLoginPost(w http.ResponseWriter, r *http.
s.renderClientMessagePage(w, r, "Share Login OK", "Share login successful, you can now use your link",
http.StatusOK, nil, "")
}
func (s *httpdServer) handleClientPing(w http.ResponseWriter, r *http.Request) {
r.Body = http.MaxBytesReader(w, r.Body, maxRequestSize)
render.PlainText(w, r, "PONG")
}