working commit

This commit is contained in:
2026-02-11 20:45:45 +02:00
parent 2e3dbe8f7c
commit d318f39f3c
15 changed files with 337 additions and 90 deletions
+7 -4
View File
@@ -18,22 +18,25 @@ import (
const zeroContentLength = "0"
func (hand *Handler) FileExists(rctx *router.Context) {
func (hand *Handler) FileInfo(rctx *router.Context) {
filepath, _ := rctx.GetSubpath("filepath")
params := &operator.FileExistsParams{
params := &operator.FileInfoParams{
Filepath: filepath,
}
ctx := rctx.GetContext()
code, res, err := hand.oper.FileExists(ctx, params)
code, res, err := hand.oper.FileInfo(ctx, params)
if err != nil {
hand.logg.Errorf("FileExists error: %v", err)
hand.logg.Errorf("FileInfo error: %v", err)
rctx.SetStatus(code)
return
}
rctx.SetHeader("Content-Collection", res.ContentCollection)
rctx.SetHeader("Content-Name", res.ContentName)
rctx.SetHeader("Content-Type", res.ContentType)
rctx.SetHeader("Content-Size", res.ContentSize)
rctx.SetHeader("Content-Digest", res.ContentDigest)
rctx.SetHeader("Content-Length", zeroContentLength)
rctx.SetStatus(code)
}