Skip to content

Commit

Permalink
支持跨域读取
Browse files Browse the repository at this point in the history
  • Loading branch information
liaochong committed Jan 12, 2024
1 parent ff98d42 commit 773ea83
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.github.liaochong</groupId>
<artifactId>myexcel</artifactId>
<version>4.5.0</version>
<version>4.5.1</version>
<packaging>jar</packaging>

<name>myexcel</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,6 @@ public static void export(Path path, String fileName, HttpServletResponse respon
private static void setAttachmentConfig(String fileName, HttpServletResponse response) throws UnsupportedEncodingException {
response.setCharacterEncoding(CharEncoding.UTF_8);
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CharEncoding.UTF_8).replace("+", "%20"));
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,6 @@ public static void export(Path path, String fileName, HttpServletResponse respon
private static void setAttachmentConfig(String fileName, HttpServletResponse response) throws UnsupportedEncodingException {
response.setCharacterEncoding(CharEncoding.UTF_8);
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, CharEncoding.UTF_8).replace("+", "%20"));
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
}
}

0 comments on commit 773ea83

Please sign in to comment.