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
parent77a733b8af393f81c1143ca27324384b1801a090 (diff)
style: uppercase sha256
SHA is an initialism. See https://github.com/golang/go/wiki/CodeReviewComments#initialisms
Diffstat (limited to 'internal')
-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
-rw-r--r--internal/source/gitlab/api/lookup_path.go2
-rw-r--r--internal/source/gitlab/factory.go2
5 files changed, 7 insertions, 7 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
diff --git a/internal/source/gitlab/api/lookup_path.go b/internal/source/gitlab/api/lookup_path.go
index 242a77c0..09934055 100644
--- a/internal/source/gitlab/api/lookup_path.go
+++ b/internal/source/gitlab/api/lookup_path.go
@@ -13,5 +13,5 @@ type LookupPath struct {
type Source struct {
Type string `json:"type,omitempty"`
Path string `json:"path,omitempty"`
- Sha256 string `json:"sha256,omitempty"`
+ SHA256 string `json:"sha256,omitempty"`
}
diff --git a/internal/source/gitlab/factory.go b/internal/source/gitlab/factory.go
index fb7a6863..312d09bf 100644
--- a/internal/source/gitlab/factory.go
+++ b/internal/source/gitlab/factory.go
@@ -25,7 +25,7 @@ func fabricateLookupPath(size int, lookup api.LookupPath) *serving.LookupPath {
return &serving.LookupPath{
ServingType: lookup.Source.Type,
Path: lookup.Source.Path,
- Sha256: lookup.Source.Sha256,
+ SHA256: lookup.Source.SHA256,
Prefix: lookup.Prefix,
IsNamespaceProject: (lookup.Prefix == "/" && size > 1),
IsHTTPSOnly: lookup.HTTPSOnly,