fix: authorization failed when link start to a wrong environment #342

This commit is contained in:
Jacky 2024-05-02 13:42:50 +08:00
parent 1e9c537bdb
commit d0924eb4ae
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
2 changed files with 6 additions and 1 deletions

View file

@ -79,6 +79,11 @@ func proxy() gin.HandlerFunc {
defer resp.Body.Close()
// rewrite status code to fix https://github.com/0xJacky/nginx-ui/issues/342
if resp.StatusCode == http.StatusForbidden {
resp.StatusCode = http.StatusServiceUnavailable
}
c.Writer.WriteHeader(resp.StatusCode)
c.Writer.Header().Add("Content-Type", resp.Header.Get("Content-Type"))