fix raw serve

This commit is contained in:
6543 2022-11-11 05:23:55 +01:00
parent 05e075dd83
commit 8418f79f79
No known key found for this signature in database
GPG Key ID: B8BE6D610E61C862
1 changed files with 2 additions and 2 deletions

View File

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