From 3e5ea9a9788b4c908a85b7ccc532e559ab8610a0 Mon Sep 17 00:00:00 2001
From: "Guo Y.K" <hi@guoyk.net>
Date: Thu, 19 May 2022 23:20:34 +0800
Subject: [PATCH] Update base.go (#19739)

use http.StatusTemporaryRedirect(307) when serve avatar directly

browser caches 301 redirections, pre-signed s3 url would expire at some later point

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
---
 routers/web/base.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/routers/web/base.go b/routers/web/base.go
index 938abaef81..5f817c77ce 100644
--- a/routers/web/base.go
+++ b/routers/web/base.go
@@ -62,7 +62,7 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
 					w,
 					req,
 					u.String(),
-					http.StatusPermanentRedirect,
+					http.StatusTemporaryRedirect,
 				)
 			})
 		}