Add ETag header to avatars (#721)

This commit is contained in:
Bwko 2017-01-25 05:26:31 +01:00 committed by Lunny Xiao
parent 8093b3372e
commit 8555e888d8
7 changed files with 50 additions and 9 deletions

View file

@ -17,13 +17,16 @@
package bindata
import (
"bytes"
"fmt"
"io"
"os"
"github.com/elazarl/go-bindata-assetfs"
"gopkg.in/macaron.v1"
)
const _VERSION = "0.1.0"
const _VERSION = "0.1.1"
func Version() string {
return _VERSION
@ -69,6 +72,15 @@ func (templates templateFileSystem) ListFiles() []macaron.TemplateFile {
return templates.files
}
func (templates templateFileSystem) Get(name string) (io.Reader, error) {
for i := range templates.files {
if templates.files[i].Name()+templates.files[i].Ext() == name {
return bytes.NewReader(templates.files[i].Data()), nil
}
}
return nil, fmt.Errorf("file '%s' not found", name)
}
func (f *templateFile) Name() string {
return f.name
}