Skip to content

Commit

Permalink
Optimize Saml2MetadataFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
leshalv authored and jzheaux committed Feb 1, 2024
1 parent 6066245 commit ceb5100
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void writeMetadataToResponse(HttpServletResponse response, Saml2Metadata
response.setContentType(MediaType.APPLICATION_XML_VALUE);
String format = "attachment; filename=\"%s\"; filename*=UTF-8''%s";
String fileName = metadata.getFileName();
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name());
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, String.format(format, fileName, encodedFileName));
response.setContentLength(metadata.getMetadata().getBytes(StandardCharsets.UTF_8).length);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
Expand Down

0 comments on commit ceb5100

Please sign in to comment.