test(handlers): add tests for passthrough headers behavior in WriteErrorResponse

This commit is contained in:
Luis Pater
2026-02-19 21:49:44 +08:00
parent e92e2af71a
commit 4445a165e9
2 changed files with 69 additions and 1 deletions

View File

@@ -810,7 +810,7 @@ func (h *BaseAPIHandler) WriteErrorResponse(c *gin.Context, msg *interfaces.Erro
if msg != nil && msg.StatusCode > 0 {
status = msg.StatusCode
}
if msg != nil && msg.Addon != nil {
if msg != nil && msg.Addon != nil && PassthroughHeadersEnabled(h.Cfg) {
for key, values := range msg.Addon {
if len(values) == 0 {
continue