]> Sergey Matveev's repositories - sgblog.git/blobdiff - cmd/sgblog/http.go
More compact Base64 ETag
[sgblog.git] / cmd / sgblog / http.go
index 2e0c2d8dea5080bcd1ecc726807106245412e8e6..000037ab210e666decf8880593d58aaab31be7af 100644 (file)
@@ -19,7 +19,7 @@ import (
        "bytes"
        "crypto/sha1"
        _ "embed"
-       "encoding/hex"
+       "encoding/base64"
        "encoding/xml"
        "errors"
        "fmt"
@@ -98,7 +98,7 @@ func makeA(href, text string) string {
 }
 
 func etagString(etag hash.Hash) string {
-       return `"` + hex.EncodeToString(etag.Sum(nil)) + `"`
+       return `"` + base64.RawURLEncoding.EncodeToString(etag.Sum(nil)) + `"`
 }
 
 func urlParse(what string) *url.URL {