(c *gin.Context, acls config.App)
| 300 | } |
| 301 | |
| 302 | func (controller *ProxyController) setHeaders(c *gin.Context, acls config.App) { |
| 303 | c.Header("Authorization", c.Request.Header.Get("Authorization")) |
| 304 | |
| 305 | headers := utils.ParseHeaders(acls.Response.Headers) |
| 306 | |
| 307 | for key, value := range headers { |
| 308 | tlog.App.Debug().Str("header", key).Msg("Setting header") |
| 309 | c.Header(key, value) |
| 310 | } |
| 311 | |
| 312 | basicPassword := utils.GetSecret(acls.Response.BasicAuth.Password, acls.Response.BasicAuth.PasswordFile) |
| 313 | |
| 314 | if acls.Response.BasicAuth.Username != "" && basicPassword != "" { |
| 315 | tlog.App.Debug().Str("username", acls.Response.BasicAuth.Username).Msg("Setting basic auth header") |
| 316 | c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(acls.Response.BasicAuth.Username, basicPassword))) |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | func (controller *ProxyController) handleError(c *gin.Context, proxyCtx ProxyContext) { |
| 321 | redirectURL := fmt.Sprintf("%s/error", controller.config.AppURL) |
no test coverage detected