Added server side validation of jpegs as images
Этот коммит содержится в:
@@ -13,8 +13,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
IMAGE_EXTENSIONS = [4]string{".jpg", ".gif", ".bmp", ".png"}
|
||||
IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"}
|
||||
IMAGE_EXTENSIONS = [5]string{".jpg", ".jpeg", ".gif", ".bmp", ".png"}
|
||||
IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".jepg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"}
|
||||
)
|
||||
|
||||
type FileUploadResponse struct {
|
||||
|
||||
@@ -101,9 +101,6 @@ module.exports = React.createClass({
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
if (items[i].type.indexOf('image') !== -1) {
|
||||
var ext = items[i].type.split('/')[1].toLowerCase();
|
||||
if (ext === 'jpeg') {
|
||||
ext = 'jpg';
|
||||
}
|
||||
|
||||
if (Constants.IMAGE_TYPES.indexOf(ext) < 0) {
|
||||
continue;
|
||||
@@ -124,9 +121,6 @@ module.exports = React.createClass({
|
||||
var file = items[i].getAsFile();
|
||||
|
||||
var ext = items[i].type.split('/')[1].toLowerCase();
|
||||
if (ext === 'jpeg') {
|
||||
ext = 'jpg';
|
||||
}
|
||||
|
||||
if (Constants.IMAGE_TYPES.indexOf(ext) < 0) {
|
||||
continue;
|
||||
|
||||
Ссылка в новой задаче
Block a user