mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-08 09:58:56 +08:00
Metadata 优化
This commit is contained in:
parent
0d55e1a4c2
commit
4f34978336
@ -47,7 +47,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
|
||||
@Controller
|
||||
@ -73,7 +73,8 @@ public class MetadataEndpoint {
|
||||
public static String IDP_METADATA_PREFIX = "Idp_Metadata_";
|
||||
|
||||
@RequestMapping(value = "/{appid}.xml",produces = "application/xml")
|
||||
public ModelAndView metadata(HttpServletRequest request,
|
||||
@ResponseBody
|
||||
public String metadata(HttpServletRequest request,
|
||||
HttpServletResponse response, @PathVariable("appid") String appId) {
|
||||
response.setContentType(ContentType.APPLICATION_XML_UTF8);
|
||||
appId = appId.substring(IDP_METADATA_PREFIX.length(), appId.length());
|
||||
@ -158,15 +159,13 @@ public class MetadataEndpoint {
|
||||
logger.trace("EntityDescriptor element XML : \\n");
|
||||
logger.trace(entityDescriptorXml);
|
||||
|
||||
ModelAndView mv = new ModelAndView("trusts/saml_v20_metadata");
|
||||
mv.addObject("metadata", entityDescriptorXml);
|
||||
return mv;
|
||||
return entityDescriptorXml;
|
||||
}catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1 +0,0 @@
|
||||
${metadata}
|
||||
Loading…
x
Reference in New Issue
Block a user