Skip to content

Commit 7f04e98

Browse files
author
TechsCode
committed
Fixed URL Encoding Issue
1 parent 8fec495 commit 7f04e98

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/me/TechsCode/ReleaseServer/WebRequestsHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public Object download(@RequestParam(value = "token", required = false) String t
5858

5959
return ResponseEntity.ok()
6060
.contentType(MediaType.APPLICATION_OCTET_STREAM)
61-
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(asset.getName(), "UTF-8") + "\"")
62-
.body(new UrlResource(asset.getPath()));
61+
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + asset.getName() + "\"")
62+
.body(new UrlResource(URLEncoder.encode(asset.getPath(), "UTF-8")));
6363
} catch (MalformedURLException | UnsupportedEncodingException e) {
6464
e.printStackTrace();
6565
return "Error: "+e.getMessage();

0 commit comments

Comments
 (0)