This commit is contained in:
6543 2022-08-12 06:14:19 +02:00
parent 672df11466
commit 9aafea59a9
No known key found for this signature in database
GPG Key ID: C99B82E40B027BAE
1 changed files with 1 additions and 0 deletions

View File

@ -89,6 +89,7 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
objType := string(resp.Header.Peek(giteaObjectTypeHeader))
log.Trace().Msgf("server raw content object: %s", objType)
if client.followSymlinks && objType == "symlink" {
// TODO: limit to 1000 chars if we switched to std
linkDest := strings.TrimSpace(string(resp.Body()))
log.Debug().Msgf("follow symlink from '%s' to '%s'", resource, linkDest)
return client.ServeRawContent(targetOwner, targetRepo, ref, linkDest)