[java-identity-provider] branch main updated: IDP-2135: IdP metadata endpoint incorrect http content-type
Brent Putman
putmanb at georgetown.edu
Sat Aug 26 06:12:14 UTC 2023
This is an automated email from the git hooks/post-receive script.
putmanb pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=7c2f614be72e08e0e69309d0c1ab1b0f072496b7
The following commit(s) were added to refs/heads/main by this push:
new 7c2f614be IDP-2135: IdP metadata endpoint incorrect http content-type
7c2f614be is described below
commit 7c2f614be72e08e0e69309d0c1ab1b0f072496b7
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Sat Aug 26 02:10:52 2023 -0400
IDP-2135: IdP metadata endpoint incorrect http content-type
---
.../resources/net/shibboleth/idp/views/admin/mdquery.vm | 3 +--
idp-war/src/main/webapp/WEB-INF/jsp/metadata.jsp | 14 +++++++-------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/views/admin/mdquery.vm b/idp-conf-impl/src/main/resources/net/shibboleth/idp/views/admin/mdquery.vm
index 3530ff37b..8cff60138 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/views/admin/mdquery.vm
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/views/admin/mdquery.vm
@@ -22,8 +22,7 @@ $response.setStatus(500)
#if ($peerCtx)
#set ($mdCtx = $peerCtx.getSubcontext("org.opensaml.saml.common.messaging.context.SAMLMetadataContext"))
#if ($mdCtx && $mdCtx.getEntityDescriptor())
-$SerializeSupport.prettyPrintXML($XMLObjectSupport.marshall($mdCtx.getEntityDescriptor()))
-$response.setContentType("text/xml")
+$response.setContentType("text/xml")$SerializeSupport.prettyPrintXML($XMLObjectSupport.marshall($mdCtx.getEntityDescriptor()))
$response.setStatus(200)
#stop
#end
diff --git a/idp-war/src/main/webapp/WEB-INF/jsp/metadata.jsp b/idp-war/src/main/webapp/WEB-INF/jsp/metadata.jsp
index 27dfc63d8..b7ab31254 100644
--- a/idp-war/src/main/webapp/WEB-INF/jsp/metadata.jsp
+++ b/idp-war/src/main/webapp/WEB-INF/jsp/metadata.jsp
@@ -12,6 +12,13 @@ if (path != null) {
if (path.isEmpty()) {
response.sendError(404);
} else {
+ final String acceptHeader = request.getHeader("Accept");
+ if (acceptHeader != null && !acceptHeader.contains("application/samlmetadata+xml")) {
+ response.setContentType("application/xml");
+ } else {
+ response.setContentType("application/samlmetadata+xml");
+ }
+
java.io.InputStreamReader in = null;
try {
in = new java.io.InputStreamReader(new java.io.FileInputStream(path),"UTF8");
@@ -30,12 +37,5 @@ if (path.isEmpty()) {
}
}
}
-
- final String acceptHeader = request.getHeader("Accept");
- if (acceptHeader != null && !acceptHeader.contains("application/samlmetadata+xml")) {
- response.setContentType("application/xml");
- } else {
- response.setContentType("application/samlmetadata+xml");
- }
}
%>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list