From f96d11896f5e55692b6e530eef2f0903255c940f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 7 Nov 2022 23:06:40 +0100 Subject: [PATCH] minimize diff --- server/upstream/upstream.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server/upstream/upstream.go b/server/upstream/upstream.go index 40345c0..df54f4f 100644 --- a/server/upstream/upstream.go +++ b/server/upstream/upstream.go @@ -83,13 +83,15 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin return true } } - log.Debug().Msg("preparations") + + log.Debug().Msg("Preparing") reader, res, err := giteaClient.ServeRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, o.TargetPath) if reader != nil { defer reader.Close() } - log.Debug().Msg("acquisition") + + log.Debug().Msg("Aquisting") // Handle errors if (err != nil && errors.Is(err, gitea.ErrorNotFound)) || (res == nil) { @@ -148,7 +150,8 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin ctx.Redirect(o.redirectIfExists, http.StatusTemporaryRedirect) return true } - log.Debug().Msg("error handling") + + log.Debug().Msg("Handling error") // Set ETag & MIME if res != nil { @@ -166,7 +169,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin } ctx.Response().Header.Set(headerLastModified, o.BranchTimestamp.In(time.UTC).Format(time.RFC1123)) - log.Debug().Msg("response preparations") + log.Debug().Msg("Prepare response") // Write the response body to the original request if reader != nil { @@ -178,7 +181,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin } } - log.Debug().Msg("response") + log.Debug().Msg("Sending response") return true }