From 03eaa2c1ba7858da8659c23258ce90ac6667e8a7 Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Wed, 29 Sep 2021 00:08:27 +0200 Subject: style: uppercase sha256 SHA is an initialism. See https://github.com/golang/go/wiki/CodeReviewComments#initialisms --- internal/serving/disk/reader.go | 6 +++--- internal/serving/disk/zip/serving_test.go | 2 +- internal/serving/lookup_path.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/serving') diff --git a/internal/serving/disk/reader.go b/internal/serving/disk/reader.go index 4cc0ad8b..26425063 100644 --- a/internal/serving/disk/reader.go +++ b/internal/serving/disk/reader.go @@ -37,7 +37,7 @@ func (reader *Reader) serveRedirectsStatus(h serving.Handler, redirects *redirec // tryRedirects returns true if it successfully handled request func (reader *Reader) tryRedirects(h serving.Handler) bool { ctx := h.Request.Context() - root, err := reader.vfs.Root(ctx, h.LookupPath.Path, h.LookupPath.Sha256) + root, err := reader.vfs.Root(ctx, h.LookupPath.Path, h.LookupPath.SHA256) if vfs.IsNotExist(err) { return false } else if err != nil { @@ -70,7 +70,7 @@ func (reader *Reader) tryRedirects(h serving.Handler) bool { func (reader *Reader) tryFile(h serving.Handler) bool { ctx := h.Request.Context() - root, err := reader.vfs.Root(ctx, h.LookupPath.Path, h.LookupPath.Sha256) + root, err := reader.vfs.Root(ctx, h.LookupPath.Path, h.LookupPath.SHA256) if vfs.IsNotExist(err) { return false } else if err != nil { @@ -133,7 +133,7 @@ func redirectPath(request *http.Request) string { func (reader *Reader) tryNotFound(h serving.Handler) bool { ctx := h.Request.Context() - root, err := reader.vfs.Root(ctx, h.LookupPath.Path, h.LookupPath.Sha256) + root, err := reader.vfs.Root(ctx, h.LookupPath.Path, h.LookupPath.SHA256) if vfs.IsNotExist(err) { return false } else if err != nil { diff --git a/internal/serving/disk/zip/serving_test.go b/internal/serving/disk/zip/serving_test.go index 66e52046..ed18e6c3 100644 --- a/internal/serving/disk/zip/serving_test.go +++ b/internal/serving/disk/zip/serving_test.go @@ -120,7 +120,7 @@ func TestZip_ServeFileHTTP(t *testing.T) { LookupPath: &serving.LookupPath{ Prefix: "/zip/", Path: test.vfsPath, - Sha256: test.sha256, + SHA256: test.sha256, }, SubPath: test.path, } diff --git a/internal/serving/lookup_path.go b/internal/serving/lookup_path.go index f5ad2ab5..421e2a51 100644 --- a/internal/serving/lookup_path.go +++ b/internal/serving/lookup_path.go @@ -5,7 +5,7 @@ type LookupPath struct { ServingType string // Serving type being used, like `zip` Prefix string // Project prefix, for example, /my/project in group.gitlab.io/my/project/index.html Path string // Path is an internal and serving-specific location of a document - Sha256 string + SHA256 string IsNamespaceProject bool // IsNamespaceProject is DEPRECATED, see https://gitlab.com/gitlab-org/gitlab-pages/issues/272 IsHTTPSOnly bool HasAccessControl bool -- cgit v1.2.3