mirror of
https://codeberg.org/scip/anydb.git
synced 2026-02-04 09:20:58 +01:00
replace fiber with http.ServeMux
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright © 2024 Thomas von Dein
|
||||
Copyright © 2024-2025 Thomas von Dein
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -122,6 +122,13 @@ func RestSet(resp http.ResponseWriter, req *http.Request, conf *cfg.Config) {
|
||||
return
|
||||
}
|
||||
|
||||
// attr.Data is a string, thus the decoder doesn't expect it to be
|
||||
// base64 encoded. However, internally we need []byte, therefore
|
||||
// we copy a cast to .Val. We also need to setup the .Preview
|
||||
// value here.
|
||||
attr.Val = []byte(attr.Data)
|
||||
attr.SetPreview()
|
||||
|
||||
err = conf.DB.Set(attr)
|
||||
if err != nil {
|
||||
JsonStatus(resp, http.StatusForbidden, "Unable to set key: "+err.Error())
|
||||
|
||||
Reference in New Issue
Block a user