mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 17:07:54 +00:00
more debug log
This commit is contained in:
parent
3ccaa17707
commit
7a7cbac171
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/valyala/fasthttp"
|
"github.com/valyala/fasthttp"
|
||||||
"github.com/valyala/fastjson"
|
"github.com/valyala/fastjson"
|
||||||
)
|
)
|
||||||
|
@ -79,7 +80,9 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
|
||||||
switch resp.StatusCode() {
|
switch resp.StatusCode() {
|
||||||
case fasthttp.StatusOK:
|
case fasthttp.StatusOK:
|
||||||
if client.followSymlinks && string(resp.Header.Peek(giteaObjectTypeHeader)) == "symlink" {
|
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
|
return resp, nil
|
||||||
|
|
Loading…
Reference in a new issue