]> Sergey Matveev's repositories - sgblog.git/blobdiff - cmd/sgblog/http.go
More compact Base64 ETag
[sgblog.git] / cmd / sgblog / http.go
index 9c39c44dab7f6ae2103ba2cca995ff5868e31d66..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 {
@@ -189,7 +189,6 @@ func serveHTTP() {
        for _, s := range []string{
                "SGBLOG",
                sgblog.Version,
-               cfg.GitPath,
                cfg.Branch,
                cfg.Title,
                cfg.URLPrefix,