MCPcopy Create free account
hub / github.com/boringproxy/boringproxy / handleLoading

Method handleLoading

ui_handler.go:780–805  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

778}
779
780func (h *WebUiHandler) handleLoading(w http.ResponseWriter, r *http.Request) {
781
782 if r.Method != "GET" {
783 w.WriteHeader(405)
784 h.alertDialog(w, r, "Invalid method for users", "/tunnels")
785 }
786
787 r.ParseForm()
788
789 pendingId := r.Form.Get("id")
790
791 h.mutex.Lock()
792 doneSignal := h.pendingRequests[pendingId]
793 delete(h.pendingRequests, pendingId)
794 h.mutex.Unlock()
795
796 result := <-doneSignal
797
798 if result.err != nil {
799 w.WriteHeader(400)
800 h.alertDialog(w, r, result.err.Error(), result.redirectUrl)
801 return
802 }
803
804 http.Redirect(w, r, result.redirectUrl, 303)
805}

Callers 1

handleWebUiRequestMethod · 0.95

Calls 1

alertDialogMethod · 0.95

Tested by

no test coverage detected