File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
feign-form/src/test/java/feign/form Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 28
28
import java .io .IOException ;
29
29
import java .util .Collection ;
30
30
import java .util .List ;
31
+ import org .apache .commons .text .StringEscapeUtils ;
31
32
import lombok .val ;
32
33
import org .apache .commons .text .StringEscapeUtils ;
33
34
import org .springframework .boot .autoconfigure .SpringBootApplication ;
@@ -169,8 +170,9 @@ public ResponseEntity<String> uploadUnknownType(@RequestPart("file") MultipartFi
169
170
@ PostMapping (path = "/upload/form_data" , consumes = MULTIPART_FORM_DATA_VALUE )
170
171
public ResponseEntity <String > uploadFormData (@ RequestPart ("file" ) MultipartFile file ) {
171
172
val status = file != null ? OK : I_AM_A_TEAPOT ;
173
+ String sanitizedFilename = StringEscapeUtils .escapeHtml4 (file .getOriginalFilename ());
172
174
return ResponseEntity .status (status )
173
- .body (file . getOriginalFilename () + ':' + file .getContentType ());
175
+ .body (sanitizedFilename + ':' + file .getContentType ());
174
176
}
175
177
176
178
@ PostMapping (path = "/submit/url" , consumes = APPLICATION_FORM_URLENCODED_VALUE )
You can’t perform that action at this time.
0 commit comments