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