From 30b2402f151929420d424d084820fec031fb12a3 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:50:08 -0800 Subject: [PATCH] services/friendbot: removed friendbot is disabled error messages that is dead code (#4059) --- .../friendbot/internal/friendbot_handler.go | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/services/friendbot/internal/friendbot_handler.go b/services/friendbot/internal/friendbot_handler.go index debb4673b3..16dd548dae 100644 --- a/services/friendbot/internal/friendbot_handler.go +++ b/services/friendbot/internal/friendbot_handler.go @@ -32,12 +32,7 @@ func (handler *FriendbotHandler) Handle(w http.ResponseWriter, r *http.Request) // doHandle is just a convenience method that returns the object to be rendered func (handler *FriendbotHandler) doHandle(r *http.Request) (*horizon.Transaction, error) { - err := handler.checkEnabled() - if err != nil { - return nil, err - } - - err = r.ParseForm() + err := r.ParseForm() if err != nil { p := problem.BadRequest p.Detail = "Request parameters are not escaped or incorrectly formatted." @@ -51,19 +46,6 @@ func (handler *FriendbotHandler) doHandle(r *http.Request) (*horizon.Transaction return handler.Friendbot.Pay(address) } -func (handler *FriendbotHandler) checkEnabled() error { - if handler.Friendbot != nil { - return nil - } - - return &problem.P{ - Type: "friendbot_disabled", - Title: "Friendbot is disabled", - Status: http.StatusForbidden, - Detail: "Friendbot is disabled on this network. Contact the server administrator if you believe this to be in error.", - } -} - func (handler *FriendbotHandler) loadAddress(r *http.Request) (string, error) { address := r.Form.Get("addr") unescaped, err := url.QueryUnescape(address)