embed: rename "v3alphaMutator" to "v3Mutator"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-02-27 14:31:32 -08:00
parent e8a368d4bd
commit c4fb5bdd23

View File

@ -250,13 +250,13 @@ func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.
// wraps HTTP multiplexer to mute requests to /v3beta
// TODO: deprecate this in 3.5 release
func wrapMux(mux *http.ServeMux) http.Handler { return &v3alphaMutator{mux: mux} }
func wrapMux(mux *http.ServeMux) http.Handler { return &v3Mutator{mux: mux} }
type v3alphaMutator struct {
type v3Mutator struct {
mux *http.ServeMux
}
func (m *v3alphaMutator) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
func (m *v3Mutator) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if req != nil && req.URL != nil && strings.HasPrefix(req.URL.Path, "/v3beta/") {
req.URL.Path = strings.Replace(req.URL.Path, "/v3beta/", "/v3/", 1)
}