fix raw serve

This commit is contained in:
6543 2022-11-11 05:23:55 +01:00
parent 7f2854d537
commit 4117775cf0
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862

View file

@ -156,9 +156,9 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin
ctx.Response().Header.Set(gitea.PagesCacheIndicatorHeader, header.Get(gitea.PagesCacheIndicatorHeader))
ctx.Response().Header.Set(gitea.ContentLengthHeader, header.Get(gitea.ContentLengthHeader))
if o.ServeRaw {
ctx.Response().Header.Set(gitea.ContentTypeHeader, header.Get(gitea.ContentTypeHeader))
} else {
ctx.Response().Header.Set(gitea.ContentTypeHeader, rawMime)
} else {
ctx.Response().Header.Set(gitea.ContentTypeHeader, header.Get(gitea.ContentTypeHeader))
}
if ctx.Response().StatusCode != http.StatusNotFound {