This commit is contained in:
2019-12-26 16:08:43 -09:00
committed by Christopher Ramey
parent 56f7663171
commit e8d5116ac2
8 changed files with 19 additions and 19 deletions

View File

@ -2,11 +2,11 @@ package pages
import (
"fmt"
"html/template"
"net/http"
"git.binarythought.com/cdramey/qurl/obj"
"git.binarythought.com/cdramey/qurl/static"
"git.binarythought.com/cdramey/qurl/storage"
"git.binarythought.com/cdramey/qurl/obj"
"html/template"
"net/http"
)
type RootHandler struct {

View File

@ -10,11 +10,11 @@ import (
)
type StaticContent struct {
Type string
Content []byte
ETag string
Type string
Content []byte
ETag string
GZIPContent []byte
GZIPETag string
GZIPETag string
}
func (sc *StaticContent) Init() {
@ -40,7 +40,7 @@ func (sc *StaticContent) Init() {
// Using gzip encoding adds a minimum of 24 characters to the HTTP
// header, so only accept gzip encoding if we save that much or more
if (buf.Len()+24) < len(sc.Content) {
if (buf.Len() + 24) < len(sc.Content) {
sc.GZIPContent = buf.Bytes()
sc.GZIPETag = fmt.Sprintf("%x", md5.Sum(sc.GZIPContent))
}