mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-16 18:30:03 +08:00
commit
046a6748c8
@ -44,6 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.regex.Pattern;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -100,6 +101,9 @@ public class MediaController extends Handler {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
if(!Pattern.matches("^https?://.*/.*$", url)) { //只允许http/https协议
|
||||
return;
|
||||
}
|
||||
byte[] data = new byte[1024];
|
||||
int length = 0;
|
||||
OutputStream out = response.getOutputStream();
|
||||
|
Loading…
x
Reference in New Issue
Block a user