prysmaticlabs / prysm

Go implementation of Ethereum proof of stake

Home Page:https://www.offchainlabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

replace gorilla mux with http.ServeMux

james-prysm opened this issue Β· comments

πŸ’Ž Issue

go now supports inbuilt routing registration meaning we may be able to get rid of the gorilla mux dependency.

Background

It doesn't seem like gorilla mux can be replaced out of the box. There are known features it does not support as well as possible side effects.

  • does not come with middleware support. currently we use the router.Use method on gorilla mux to register middleware and so we would need some added utility to register the middleware
  • I'm not sure if CORs support comes out of the box and so that would need to be added as well
  • changing the .Method validation on registration to be part of the path definition as defined in this article https://go.dev/blog/routing-enhancements
  • better understand the effects and changes to path variables or query parameters
  • test if sub routes are effected ( especially regarding the web UI)

TODO:

  • replace all references of gorilla mux with HTTP library or a new package under API to support features
  • remove go.mod dependency and running go mod tidy
  • Test rest implementation and do web app sanity check

Dependent on #14089 merging

I am on this plz assign this to me @james-prysm

merged in