forked from vieter-v/vieter
feat(web): file() now handles HEAD requests
This commit is contained in:
parent
3a73ea0632
commit
e7b45bf251
2 changed files with 20 additions and 79 deletions
|
|
@ -45,15 +45,6 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re
|
|||
full_path = os.join_path(app.repo.repos_dir, repo, arch, filename, 'desc')
|
||||
}
|
||||
|
||||
// Scuffed way to respond to HEAD requests
|
||||
if app.req.method == http.Method.head {
|
||||
if os.exists(full_path) {
|
||||
return app.status(http.Status.ok)
|
||||
}
|
||||
|
||||
return app.not_found()
|
||||
}
|
||||
|
||||
return app.file(full_path)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue