MCPcopy Create free account
hub / github.com/cairoeth/preconfirmations / HandleHTTPRequest

Method HandleHTTPRequest

rpc/server/server.go:223–242  ·  view source on GitHub ↗
(respw http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

221}
222
223func (s *RPCEndPointServer) HandleHTTPRequest(respw http.ResponseWriter, req *http.Request) {
224 setCorsHeaders(respw)
225
226 if req.Method == http.MethodGet {
227 if strings.Trim(req.URL.Path, "/") == "fast" {
228 http.Redirect(respw, req, "https://docs.flashbots.net/flashbots-protect/quick-start#faster-transactions", http.StatusFound)
229 } else {
230 http.Redirect(respw, req, "https://docs.flashbots.net/flashbots-protect/rpc/quick-start/", http.StatusFound)
231 }
232 return
233 }
234
235 if req.Method == http.MethodOptions {
236 respw.WriteHeader(http.StatusOK)
237 return
238 }
239
240 request := NewRPCRequestHandler(s.logger, &respw, req, s.proxyURL, s.proxyTimeoutSeconds, s.relaySigningKey, s.relayURL, s.db, s.builderNameProvider.BuilderNames(), s.chainID)
241 request.process()
242}
243
244func (s *RPCEndPointServer) handleDrain(respw http.ResponseWriter, req *http.Request) {
245 s.isHealthyMx.Lock()

Callers

nothing calls this directly

Calls 4

processMethod · 0.95
setCorsHeadersFunction · 0.85
NewRPCRequestHandlerFunction · 0.85
BuilderNamesMethod · 0.65

Tested by

no test coverage detected