Skip to content

Commit a6792bd

Browse files
author
TechsCode
committed
Fixed URL Encoding Issue #3
1 parent 7f04e98 commit a6792bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public Object download(@RequestParam(value = "token", required = false) String t
5959
return ResponseEntity.ok()
6060
.contentType(MediaType.APPLICATION_OCTET_STREAM)
6161
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + asset.getName() + "\"")
62-
.body(new UrlResource(URLEncoder.encode(asset.getPath(), "UTF-8")));
63-
} catch (MalformedURLException | UnsupportedEncodingException e) {
62+
.body(new UrlResource(asset.toURI()));
63+
} catch (MalformedURLException e) {
6464
e.printStackTrace();
6565
return "Error: "+e.getMessage();
6666
}

0 commit comments

Comments
 (0)