Remove unnecessary conversion

- Remove unnecessary type conversion.
- Found via: `golangci-lint run --enable unconvert ./...`
This commit is contained in:
Gusted 2022-11-13 12:11:55 +01:00
parent 3c61a39864
commit df5199c9a3
No known key found for this signature in database
GPG key ID: FD821B732837125F
7 changed files with 21 additions and 21 deletions

View file

@ -82,7 +82,7 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client) (fin
// Check if the browser has a cached version
if ctx.Response() != nil {
if ifModifiedSince, err := time.Parse(time.RFC1123, string(ctx.Response().Header.Get(headerIfModifiedSince))); err == nil {
if ifModifiedSince, err := time.Parse(time.RFC1123, ctx.Response().Header.Get(headerIfModifiedSince)); err == nil {
if !ifModifiedSince.Before(o.BranchTimestamp) {
ctx.RespWriter.WriteHeader(http.StatusNotModified)
log.Trace().Msg("check response against last modified: valid")