From 2ee4aebd969ecef88d347dd9b51a438de501d286 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sun, 15 Oct 2023 17:02:40 +0800 Subject: [PATCH] Fix error handling in GetSamlMeta() --- controllers/saml.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/saml.go b/controllers/saml.go index 01f96276..8d7eeb26 100644 --- a/controllers/saml.go +++ b/controllers/saml.go @@ -33,7 +33,13 @@ func (c *ApiController) GetSamlMeta() { c.ResponseError(fmt.Sprintf(c.T("saml:Application %s not found"), paramApp)) return } - metadata, _ := object.GetSamlMeta(application, host) + + metadata, err := object.GetSamlMeta(application, host) + if err != nil { + c.ResponseError(err.Error()) + return + } + c.Data["xml"] = metadata c.ServeXML() }