From 13cb88e27d100c207f0b846426fc48fa667e6067 Mon Sep 17 00:00:00 2001 From: Havrileck Alexandre Date: Sun, 25 Apr 2021 18:09:37 +0200 Subject: [PATCH] fix(responsehandler): Fix no helpers for internal server error specific case template --- pkg/s3-proxy/response-handler/error-handlers.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/s3-proxy/response-handler/error-handlers.go b/pkg/s3-proxy/response-handler/error-handlers.go index 05fc754c..4e85aecd 100644 --- a/pkg/s3-proxy/response-handler/error-handlers.go +++ b/pkg/s3-proxy/response-handler/error-handlers.go @@ -428,13 +428,21 @@ func (h *handler) InternalServerError( // Check if target config and template exists if tplCfgItem != nil { // Load template content - tplContent, err2 = h.loadTemplateContent( + tpl, err3 := h.loadTemplateContent( loadFileContent, tplCfgItem, ) + // Concat + tplContent = tplContent + "\n" + tpl + // Save error + err2 = err3 } else { // Get template from general configuration - tplContent, err2 = loadLocalFileContent(cfg.Templates.InternalServerError.Path) + tpl, err3 := loadLocalFileContent(cfg.Templates.InternalServerError.Path) + // Concat + tplContent = tplContent + "\n" + tpl + // Save error + err2 = err3 } }