mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Implement domain request failure
This commit is contained in:
parent
53946e878f
commit
a3140efb20
@ -288,6 +288,24 @@ func Listen() {
|
|||||||
http.Redirect(w, r, fmt.Sprintf("https://%s/edit-tunnel?domain=%s", adminDomain, domain), 303)
|
http.Redirect(w, r, fmt.Sprintf("https://%s/edit-tunnel?domain=%s", adminDomain, domain), 303)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if r.URL.Path == "/dnsapi/failure" {
|
||||||
|
|
||||||
|
r.ParseForm()
|
||||||
|
|
||||||
|
requestId := r.Form.Get("request-id")
|
||||||
|
|
||||||
|
// Ensure the request exists
|
||||||
|
_, err := db.GetDNSRequest(requestId)
|
||||||
|
if err != nil {
|
||||||
|
w.WriteHeader(500)
|
||||||
|
io.WriteString(w, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
db.DeleteDNSRequest(requestId)
|
||||||
|
|
||||||
|
http.Redirect(w, r, "/alert?message=Domain request failed", 303)
|
||||||
|
|
||||||
} else if hostDomain == db.GetAdminDomain() {
|
} else if hostDomain == db.GetAdminDomain() {
|
||||||
if strings.HasPrefix(r.URL.Path, "/api/") {
|
if strings.HasPrefix(r.URL.Path, "/api/") {
|
||||||
http.StripPrefix("/api", api).ServeHTTP(w, r)
|
http.StripPrefix("/api", api).ServeHTTP(w, r)
|
||||||
|
@ -38,6 +38,7 @@ type DNSRecord struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
TTL int `json:"ttl"`
|
TTL int `json:"ttl"`
|
||||||
|
Priority int `json:"priority"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tunnel struct {
|
type Tunnel struct {
|
||||||
|
@ -259,6 +259,13 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
|
|||||||
http.Redirect(w, r, "/tunnels", 303)
|
http.Redirect(w, r, "/tunnels", 303)
|
||||||
case "/loading":
|
case "/loading":
|
||||||
h.handleLoading(w, r)
|
h.handleLoading(w, r)
|
||||||
|
case "/alert":
|
||||||
|
|
||||||
|
r.ParseForm()
|
||||||
|
|
||||||
|
message := r.Form.Get("message")
|
||||||
|
|
||||||
|
h.alertDialog(w, r, message, "/")
|
||||||
default:
|
default:
|
||||||
if strings.HasPrefix(r.URL.Path, "/tunnels/") {
|
if strings.HasPrefix(r.URL.Path, "/tunnels/") {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user