reduce duplicate in Get method (#1880)

make code more clear to people!
pull/1885/head
Abdulaziz 2022-05-01 10:34:53 +03:00 committed by GitHub
parent bd4f1538e0
commit d277bbfce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
app.go
View File

@ -640,7 +640,7 @@ func (app *App) Use(args ...interface{}) Router {
// Get registers a route for GET methods that requests a representation
// of the specified resource. Requests using GET should only retrieve data.
func (app *App) Get(path string, handlers ...Handler) Router {
return app.Add(MethodHead, path, handlers...).Add(MethodGet, path, handlers...)
return app.Head(path, handlers...).Add(MethodGet, path, handlers...)
}
// Head registers a route for HEAD methods that asks for a response identical