diff --git a/routing/routes.go b/routing/routes.go index a9504cda2d90ab8603f060238ae65ba79146cdca..f51616b91bb1225dcfcd6eeeb1a48f07b7cacf95 100644 --- a/routing/routes.go +++ b/routing/routes.go @@ -130,7 +130,7 @@ func SetRoutes( router *f.App, config *configuration.Config, store state.Store, statePathGroup.Put( "/:name", func( c *f.Ctx ) error { - contentType := c.Get( "Content-Type" ) + contentType := strings.Clone( c.Get( "Content-Type" ) ) _, _, err := mime.ParseMediaType( contentType ) if err != nil { c.Status( http.StatusBadRequest ) @@ -139,7 +139,7 @@ func SetRoutes( router *f.App, config *configuration.Config, store state.Store, ) } - name := c.Params( "name" ) + name := strings.Clone( c.Params( "name" ) ) existingItem, err := store.Fetch( name ) if err != nil { c.Status( http.StatusInternalServerError ) @@ -175,7 +175,7 @@ func SetRoutes( router *f.App, config *configuration.Config, store state.Store, statePathGroup.Delete( "/:name", func( c *f.Ctx ) error { - name := c.Params( "name" ) + name := strings.Clone( c.Params( "name" ) ) existingItem, err := store.Fetch( name ) if err != nil { return c.SendStatus( http.StatusInternalServerError )