forked from TrueCloudLab/frostfs-http-gw
Fixes after review
- It's confusing. If there is no difference, I suggest having the route named after the protocol verb or resulting handler. So it should be either post or upload. - Don't you find that it would be more understandable without else ifs? - Why do we need a temporary file here? - etc Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
3cbd4dbd09
commit
ec70bfa4cc
3 changed files with 50 additions and 32 deletions
4
app.go
4
app.go
|
@ -181,8 +181,8 @@ func (a *app) Serve(ctx context.Context) {
|
|||
r := router.New()
|
||||
r.RedirectTrailingSlash = true
|
||||
|
||||
a.log.Info("enabled /put/{cid}")
|
||||
r.POST("/put/{cid}", a.upload)
|
||||
a.log.Info("enabled /upload/{cid}")
|
||||
r.POST("/upload/{cid}", a.upload)
|
||||
|
||||
a.log.Info("enabled /get/{cid}/{oid}")
|
||||
r.GET("/get/{cid}/{oid}", a.byAddress)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue