Skip to content

Commit

Permalink
!443 规范导出,防止跨域无法获取文件名称
Browse files Browse the repository at this point in the history
Merge pull request !443 from twelvet/N/A
  • Loading branch information
lltx authored and gitee-org committed Nov 16, 2023
2 parents 6d0e014 + eb6df8d commit 2235875
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void download(String tableIds, HttpServletResponse response) {
byte[] data = outputStream.toByteArray();

response.reset();
response.setHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION);
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s.zip", tableIds));
response.addHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(data.length));
response.setContentType("application/octet-stream; charset=UTF-8");
Expand Down

0 comments on commit 2235875

Please sign in to comment.