Distribute and handle challenge.json
This commit is contained in:
parent
e8f6a03cd9
commit
dff4f4eb63
20 changed files with 167 additions and 48 deletions
|
@ -107,6 +107,14 @@ func init() {
|
|||
fwd_request(w, r, "http://127.0.0.1:8081/")
|
||||
}
|
||||
})
|
||||
api.Router().GET("/challenge.json", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
if forwarder != nil {
|
||||
fwd_request(w, r, *forwarder)
|
||||
} else {
|
||||
http.ServeFile(w, r, path.Join(settings.SettingsDir, settings.ChallengeFile))
|
||||
}
|
||||
})
|
||||
api.Router().GET("/settings.json", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
if forwarder != nil {
|
||||
|
|
Reference in a new issue