File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
spring-web/src/main/java/org/springframework/http Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -861,7 +861,7 @@ public List<String> getConnection() {
861
861
public void setContentDispositionFormData (String name , @ Nullable String filename ) {
862
862
Assert .notNull (name , "Name must not be null" );
863
863
ContentDisposition .Builder disposition = ContentDisposition .builder ("form-data" ).name (name );
864
- if (filename != null ) {
864
+ if (StringUtils . hasText ( filename ) ) {
865
865
disposition .filename (filename );
866
866
}
867
867
setContentDisposition (disposition .build ());
@@ -888,7 +888,7 @@ public void setContentDisposition(ContentDisposition contentDisposition) {
888
888
*/
889
889
public ContentDisposition getContentDisposition () {
890
890
String contentDisposition = getFirst (CONTENT_DISPOSITION );
891
- if (contentDisposition != null ) {
891
+ if (StringUtils . hasText ( contentDisposition ) ) {
892
892
return ContentDisposition .parse (contentDisposition );
893
893
}
894
894
return ContentDisposition .empty ();
You can’t perform that action at this time.
0 commit comments