more logging ...

This commit is contained in:
6543 2022-08-12 05:36:24 +02:00
parent b9ac62bdae
commit 672df11466
No known key found for this signature in database
GPG Key ID: C99B82E40B027BAE
2 changed files with 5 additions and 1 deletions

View File

@ -68,11 +68,13 @@ var ServeFlags = []cli.Flag{
Name: "enable-lfs-support",
Usage: "enable lfs support, require gitea v1.17.0 as backend",
EnvVars: []string{"ENABLE_LFS_SUPPORT"},
Value: true,
},
&cli.BoolFlag{
Name: "enable-symlink-support",
Usage: "follow symlinks if enabled, require gitea v1.18.0 as backend",
EnvVars: []string{"ENABLE_SYMLINK_SUPPORT"},
Value: true,
},
&cli.StringFlag{
Name: "log-level",

View File

@ -86,7 +86,9 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
switch resp.StatusCode() {
case fasthttp.StatusOK:
if client.followSymlinks && string(resp.Header.Peek(giteaObjectTypeHeader)) == "symlink" {
objType := string(resp.Header.Peek(giteaObjectTypeHeader))
log.Trace().Msgf("server raw content object: %s", objType)
if client.followSymlinks && objType == "symlink" {
linkDest := strings.TrimSpace(string(resp.Body()))
log.Debug().Msgf("follow symlink from '%s' to '%s'", resource, linkDest)
return client.ServeRawContent(targetOwner, targetRepo, ref, linkDest)