Skip to content

Commit

Permalink
Add samlmetadata Qualifier to Content Type
Browse files Browse the repository at this point in the history
Closes gh-15147
  • Loading branch information
jzheaux committed Jun 21, 2024
1 parent 78d2be9 commit a529607
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,6 @@
import jakarta.servlet.http.HttpServletResponse;

import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.security.saml2.Saml2Exception;
import org.springframework.security.saml2.provider.service.metadata.Saml2MetadataResolver;
import org.springframework.security.saml2.provider.service.metadata.Saml2MetadataResponse;
Expand Down Expand Up @@ -103,7 +102,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse

private void writeMetadataToResponse(HttpServletResponse response, Saml2MetadataResponse metadata)
throws IOException {
response.setContentType(MediaType.APPLICATION_XML_VALUE);
response.setContentType("application/samlmetadata+xml");
String format = "attachment; filename=\"%s\"; filename*=UTF-8''%s";
String fileName = metadata.getFileName();
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
Expand Down

0 comments on commit a529607

Please sign in to comment.