mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-07-18 00:45:52 +00:00
remove unnecessary file processing in display.go
There is no need to open the file here; nothing is done with the header after it is read.
This commit is contained in:
parent
9467be9717
commit
93d37002dd
1 changed files with 0 additions and 6 deletions
|
|
@ -39,12 +39,6 @@ func fileDisplayHandler(c web.C, w http.ResponseWriter, r *http.Request) {
|
|||
extra := make(map[string]string)
|
||||
lines := []string{}
|
||||
|
||||
file, _ := fileBackend.Open(fileName)
|
||||
defer file.Close()
|
||||
|
||||
header := make([]byte, 512)
|
||||
file.Read(header)
|
||||
|
||||
extension := strings.TrimPrefix(filepath.Ext(fileName), ".")
|
||||
|
||||
if strings.EqualFold("application/json", r.Header.Get("Accept")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue