mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: authorization failed when link start to a wrong environment #342
This commit is contained in:
parent
1e9c537bdb
commit
d0924eb4ae
2 changed files with 6 additions and 1 deletions
|
@ -120,7 +120,7 @@ const visible = computed(() => {
|
||||||
|
|
||||||
<AButton
|
<AButton
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="env.id === item.id"
|
:disabled="!item.status || env.id === item.id"
|
||||||
ghost
|
ghost
|
||||||
@click="link_start(item)"
|
@click="link_start(item)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -79,6 +79,11 @@ func proxy() gin.HandlerFunc {
|
||||||
|
|
||||||
defer resp.Body.Close()
|
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.WriteHeader(resp.StatusCode)
|
||||||
|
|
||||||
c.Writer.Header().Add("Content-Type", resp.Header.Get("Content-Type"))
|
c.Writer.Header().Add("Content-Type", resp.Header.Get("Content-Type"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue