diff --git a/server/gitea/client.go b/server/gitea/client.go index 7d21020..eeb0498 100644 --- a/server/gitea/client.go +++ b/server/gitea/client.go @@ -130,10 +130,8 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str return nil, nil, http.StatusInternalServerError, ErrorNotFound } cache.Body = body.([]byte) - // TODO: don't grab the content from the cache if the ETag matches?! cachedHeader, cachedStatusCode := cache.createHttpResponse(cacheKey) - // TODO: check against some timestamp mismatch?!? if cache.Exists { if cache.IsSymlink { linkDest := string(cache.Body) @@ -147,7 +145,6 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str return nil, nil, http.StatusNotFound, ErrorNotFound } } - // TODO: metadata not written, is close ever called? log.Trace().Msg("file not in cache") // not in cache, open reader via gitea api reader, resp, err := client.sdkClient.GetFileReader(targetOwner, targetRepo, ref, resource, client.supportLFS) diff --git a/server/upstream/header.go b/server/upstream/header.go index 3a218a1..7b85df1 100644 --- a/server/upstream/header.go +++ b/server/upstream/header.go @@ -24,8 +24,5 @@ func (o *Options) setHeader(ctx *context.Context, header http.Header) { } else { ctx.RespWriter.Header().Set(gitea.ContentTypeHeader, mime) } - if encoding := header.Get(gitea.ContentEncodingHeader); encoding != "" && encoding != "identity" { - ctx.RespWriter.Header().Set(gitea.ContentEncodingHeader, encoding) - } ctx.RespWriter.Header().Set(headerLastModified, o.BranchTimestamp.In(time.UTC).Format(http.TimeFormat)) } diff --git a/server/upstream/upstream.go b/server/upstream/upstream.go index 98137ba..2f1751b 100644 --- a/server/upstream/upstream.go +++ b/server/upstream/upstream.go @@ -182,7 +182,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client, redi // add extension for encoding path := o.TargetPath + allowedEncodings[encoding] - reader, header, statusCode, err = giteaClient.ServeRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, path, true) + reader, header, statusCode, err = giteaClient.ServeRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, path) if statusCode == 404 { continue }