more debug log

This commit is contained in:
6543 2022-07-22 01:00:48 +02:00
parent 3ccaa17707
commit 7a7cbac171
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE

View file

@ -7,6 +7,7 @@ import (
"strings"
"time"
"github.com/rs/zerolog/log"
"github.com/valyala/fasthttp"
"github.com/valyala/fastjson"
)
@ -79,7 +80,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" {
return client.ServeRawContent(targetOwner, targetRepo, ref, strings.TrimSpace(string(resp.Body())))
linkDest := strings.TrimSpace(string(resp.Body()))
log.Debug().Msgf("follow symlink from '%s' to '%s'", resource, linkDest)
return client.ServeRawContent(targetOwner, targetRepo, ref, linkDest)
}
return resp, nil