Skip to content

Commit effd882

Browse files
fix: add attachment name and setup OpenAPI response properly
Signed-off-by: Joris Mancini <joris.mancini_externe@rte-france.com>
1 parent a06b165 commit effd882

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/powsybl/caseserver/Utils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package com.powsybl.caseserver;
88

99
import com.powsybl.commons.datasource.DataSourceUtil;
10+
import org.springframework.http.ContentDisposition;
1011
import org.springframework.http.HttpHeaders;
1112

1213
import java.util.List;
@@ -60,6 +61,9 @@ public static HttpHeaders buildHeaders(String name, Boolean isUploadedAsPlainFil
6061
if (Boolean.TRUE.equals(isUploadedAsPlainFile)) {
6162
headers.add(HttpHeaders.CONTENT_ENCODING, GZIP_ENCODING);
6263
}
64+
headers.setContentDisposition(
65+
ContentDisposition.attachment().filename(name).build()
66+
);
6367
return headers;
6468
}
6569
}

0 commit comments

Comments
 (0)