This commit is contained in:
parent
ea3576da7e
commit
3eb2806f29
@ -268,7 +268,7 @@ func (i *File) GetFileType(checkContent bool) error {
|
|||||||
|
|
||||||
End:
|
End:
|
||||||
// If the file type is text, save its content.
|
// If the file type is text, save its content.
|
||||||
if i.Type == "text" {
|
if i.Type == "text" && i.Size < 10240 { // Avoiding files that are too large causes browsers to crash
|
||||||
if len(content) == 0 {
|
if len(content) == 0 {
|
||||||
content, err = ioutil.ReadFile(i.Path)
|
content, err = ioutil.ReadFile(i.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user