feat: add files/upload/limit endpoint

This commit is contained in:
Derrick Hammer 2023-06-10 01:58:45 -04:00
parent 86380c7b3a
commit b77bebe3b1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 9 additions and 0 deletions

View File

@ -156,6 +156,10 @@ func (f *FilesController) PostPinBy(cidString string) {
f.Ctx.StatusCode(iris.StatusCreated) f.Ctx.StatusCode(iris.StatusCreated)
} }
func (f *FilesController) GetUploadLimit() {
f.respondJSON(&response.UploadLimit{Limit: f.Ctx.Application().ConfigurationReadOnly().GetPostMaxMemory()})
}
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) { func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
_, err := cid.Valid(cidString) _, err := cid.Valid(cidString)
if sendError(ctx, err, iris.StatusBadRequest) { if sendError(ctx, err, iris.StatusBadRequest) {

View File

@ -0,0 +1,5 @@
package response
type UploadLimit struct {
Limit int64 `json:"limit"`
}