Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-09-29 01:08:27 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-11-08 18:27:31 +0300
commit03eaa2c1ba7858da8659c23258ce90ac6667e8a7 (patch)
tree13d058c172e9e2fb986b82ea39e9ef2c96afb02b /internal/serving
parent77a733b8af393f81c1143ca27324384b1801a090 (diff)
style: uppercase sha256
SHA is an initialism. See https://github.com/golang/go/wiki/CodeReviewComments#initialisms
Diffstat (limited to 'internal/serving')
-rw-r--r--internal/serving/disk/reader.go6
-rw-r--r--internal/serving/disk/zip/serving_test.go2
-rw-r--r--internal/serving/lookup_path.go2
3 files changed, 5 insertions, 5 deletions
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