forked from vieter-v/vieter
refactor(server): migrated all routes to new auth system
This commit is contained in:
parent
4887af26d3
commit
272f14b264
6 changed files with 13 additions and 78 deletions
|
|
@ -49,12 +49,8 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re
|
|||
}
|
||||
|
||||
// put_package handles publishing a package to a repository.
|
||||
['/:repo/publish'; post]
|
||||
['/:repo/publish'; auth; post]
|
||||
fn (mut app App) put_package(repo string) web.Result {
|
||||
if !app.is_authorized() {
|
||||
return app.json(http.Status.unauthorized, new_response('Unauthorized.'))
|
||||
}
|
||||
|
||||
mut pkg_path := ''
|
||||
|
||||
if length := app.req.header.get(.content_length) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue