Pull request: all: imp http handlers, imp docs

Merge in DNS/adguard-home from fix-openapi to master

Squashed commit of the following:

commit 0e7530472fb566e5cab73d178c8ec16e5ef11dcb
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Jan 13 17:02:06 2021 +0300

    all: imp http handlers, imp docs
This commit is contained in:
Ainar Garipov 2021-01-13 17:26:57 +03:00
parent e8c1f5c8d3
commit 4474e9fcf9
7 changed files with 87 additions and 27 deletions
internal/home

View file

@ -369,8 +369,8 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
// RegisterAuthHandlers - register handlers
func RegisterAuthHandlers() {
Context.mux.Handle("/control/login", postInstallHandler(ensureHandler("POST", handleLogin)))
httpRegister("GET", "/control/logout", handleLogout)
Context.mux.Handle("/control/login", postInstallHandler(ensureHandler(http.MethodPost, handleLogin)))
httpRegister(http.MethodGet, "/control/logout", handleLogout)
}
func parseCookie(cookie string) string {