forked from vieter-v/vieter
Compare commits
2 Commits
3e0a2584fa
...
78fd6d8d58
| Author | SHA1 | Date |
|---|---|---|
|
|
78fd6d8d58 | |
|
|
0f73e904d9 |
|
|
@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
repository will be cloned with the default branch
|
repository will be cloned with the default branch
|
||||||
* Build containers now explicitely set the PATH variable
|
* Build containers now explicitely set the PATH variable
|
||||||
* Refactor of web framework
|
* Refactor of web framework
|
||||||
|
* `api` can no longer be used as a repository name
|
||||||
|
* CLI client now allows setting values to an empty value
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,10 @@ fn (c &Client) send_request_raw(method Method, url string, params map[string]str
|
||||||
// Escape each query param
|
// Escape each query param
|
||||||
for k, v in params {
|
for k, v in params {
|
||||||
// An empty parameter should be the same as not providing it at all
|
// An empty parameter should be the same as not providing it at all
|
||||||
if v != '' {
|
|
||||||
params_escaped[k] = urllib.query_escape(v)
|
params_escaped[k] = urllib.query_escape(v)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
params_str := params_escaped.keys().map('$it=${params[it]}').join('&')
|
params_str := params_escaped.keys().map('$it=${params_escaped[it]}').join('&')
|
||||||
|
|
||||||
full_url = '$full_url?$params_str'
|
full_url = '$full_url?$params_str'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,12 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re
|
||||||
// put_package handles publishing a package to a repository.
|
// put_package handles publishing a package to a repository.
|
||||||
['/:repo/publish'; auth; post]
|
['/:repo/publish'; auth; post]
|
||||||
fn (mut app App) put_package(repo string) web.Result {
|
fn (mut app App) put_package(repo string) web.Result {
|
||||||
|
// api is a reserved keyword for api routes & should never be allowed to be
|
||||||
|
// a repository.
|
||||||
|
if repo.to_lower() == 'api' {
|
||||||
|
return app.json(.bad_request, new_response("'api' is a reserved keyword & cannot be used as a repository name."))
|
||||||
|
}
|
||||||
|
|
||||||
mut pkg_path := ''
|
mut pkg_path := ''
|
||||||
|
|
||||||
if length := app.req.header.get(.content_length) {
|
if length := app.req.header.get(.content_length) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue