()
| 115 | } |
| 116 | |
| 117 | func LoadErrCode() int { |
| 118 | settingRepo := repo.NewISettingRepo() |
| 119 | codeVal, err := settingRepo.GetValueByKey("NoAuthSetting") |
| 120 | if err != nil { |
| 121 | return http.StatusInternalServerError |
| 122 | } |
| 123 | |
| 124 | switch codeVal { |
| 125 | case "400": |
| 126 | return http.StatusBadRequest |
| 127 | case "401": |
| 128 | return http.StatusUnauthorized |
| 129 | case "403": |
| 130 | return http.StatusForbidden |
| 131 | case "404": |
| 132 | return http.StatusNotFound |
| 133 | case "408": |
| 134 | return http.StatusRequestTimeout |
| 135 | case "416": |
| 136 | return http.StatusRequestedRangeNotSatisfiable |
| 137 | case "500": |
| 138 | return http.StatusInternalServerError |
| 139 | case "444": |
| 140 | return 444 |
| 141 | default: |
| 142 | return http.StatusOK |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | func IsFrontendPath(path string) bool { |
| 147 | reqUri := strings.TrimSuffix(path, "/") |
no test coverage detected