File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
services/src/main/java/io/scalecube/services/files Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -96,17 +96,17 @@ public Flux<ServiceMessage> streamFile() {
96
96
.flatMapMany (
97
97
context -> {
98
98
final var headers = context .headers ();
99
- final var name = context .pathVar ("name " );
100
- final var path = baseDir .resolve (name );
99
+ final var filename = context .pathVar ("filename " );
100
+ final var path = baseDir .resolve (filename );
101
101
102
102
if (!isPathValid (path )) {
103
- return Flux .error (new FileNotFoundException ("File not found: " + name ));
103
+ return Flux .error (new FileNotFoundException ("File not found: " + filename ));
104
104
}
105
105
106
106
final var message =
107
107
ServiceMessage .from (headers )
108
108
.header ("Content-Type" , "application/octet-stream" )
109
- .header ("Content-Disposition" , "attachment; filename=" + name )
109
+ .header ("Content-Disposition" , "attachment; filename=" + filename )
110
110
.build ();
111
111
112
112
return Flux .just (message )
Original file line number Diff line number Diff line change @@ -21,6 +21,6 @@ public interface FileStreamer {
21
21
@ Tag (key = "Content-Type" , value = "application/file" )
22
22
@ RestMethod ("GET" )
23
23
@ ResponseType (byte [].class )
24
- @ ServiceMethod ("${microservices:id}/files/:name " )
24
+ @ ServiceMethod ("${microservices:id}/files/:filename " )
25
25
Flux <ServiceMessage > streamFile ();
26
26
}
You can’t perform that action at this time.
0 commit comments