From 28fe3db1fb0f89bcb55829ced33c1282f85f6e97 Mon Sep 17 00:00:00 2001 From: cchangwen <157893811+cchangwen@users.noreply.github.com> Date: Tue, 30 Jan 2024 00:18:40 +0800 Subject: [PATCH 01/13] Also match weakly validated ETags (#28957) https://stackoverflow.com/questions/51973120/where-does-the-w-in-an-etag-appear-from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag# --------- Co-authored-by: delvh --- modules/httpcache/httpcache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/httpcache/httpcache.go b/modules/httpcache/httpcache.go index b57b3218322c..40458dfc336e 100644 --- a/modules/httpcache/httpcache.go +++ b/modules/httpcache/httpcache.go @@ -59,7 +59,7 @@ func checkIfNoneMatchIsValid(req *http.Request, etag string) bool { ifNoneMatch := req.Header.Get("If-None-Match") if len(ifNoneMatch) > 0 { for _, item := range strings.Split(ifNoneMatch, ",") { - item = strings.TrimSpace(item) + item = strings.TrimPrefix(strings.TrimSpace(item), "W/") // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag#directives if item == etag { return true } From 37ede3197a74ba43c95029101ca37b3f9e7cc325 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Mon, 29 Jan 2024 21:54:52 -0300 Subject: [PATCH 02/13] Fix google logo in security page (#28982) Fix google logo in user security page: #28701 Before ![before user security page](https://github.com/go-gitea/gitea/assets/50121801/6c058c28-8013-470a-b047-f47afecdca09) after ![user security page](https://github.com/go-gitea/gitea/assets/50121801/36053ee9-18c5-4ef0-a63a-8accc1d00adc) --- public/assets/img/svg/gitea-google.svg | 2 +- web_src/svg/gitea-google.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/img/svg/gitea-google.svg b/public/assets/img/svg/gitea-google.svg index 9629ca03b6a6..7dd2622df6a0 100644 --- a/public/assets/img/svg/gitea-google.svg +++ b/public/assets/img/svg/gitea-google.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/web_src/svg/gitea-google.svg b/web_src/svg/gitea-google.svg index dbb741897ce9..d15a591b60da 100644 --- a/web_src/svg/gitea-google.svg +++ b/web_src/svg/gitea-google.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 8ef53c871bcb5c007b3640a347c7868585c9e4de Mon Sep 17 00:00:00 2001 From: Mike Cifelli <26522946+macifell@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:11:11 -0500 Subject: [PATCH 03/13] Update golang links to use https (#28980) Many of the golang links point to the old site and don't use https. This pull request updates these outdated links to https://go.dev . https://github.com/go-gitea/gitea/issues/28979 --- CONTRIBUTING.md | 2 +- .../content/administration/environment-variables.zh-cn.md | 4 ++-- docs/content/administration/mail-templates.en-us.md | 8 ++++---- docs/content/administration/mail-templates.zh-cn.md | 8 ++++---- docs/content/development/hacking-on-gitea.en-us.md | 2 +- docs/content/development/hacking-on-gitea.zh-cn.md | 2 +- docs/content/installation/from-source.en-us.md | 8 ++++---- docs/content/installation/from-source.zh-cn.md | 4 ++-- options/locale/locale_en-US.ini | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b43ce01ff24b..a201f2fc381c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ See the [development setup instructions](https://docs.gitea.com/development/hack ### Backend -Go dependencies are managed using [Go Modules](https://golang.org/cmd/go/#hdr-Module_maintenance). \ +Go dependencies are managed using [Go Modules](https://go.dev/cmd/go/#hdr-Module_maintenance). \ You can find more details in the [go mod documentation](https://go.dev/ref/mod) and the [Go Modules Wiki](https://github.com/golang/go/wiki/Modules). Pull requests should only modify `go.mod` and `go.sum` where it is related to your change, be it a bugfix or a new feature. \ diff --git a/docs/content/administration/environment-variables.zh-cn.md b/docs/content/administration/environment-variables.zh-cn.md index 25e120becdc5..d5be9e03c256 100644 --- a/docs/content/administration/environment-variables.zh-cn.md +++ b/docs/content/administration/environment-variables.zh-cn.md @@ -29,9 +29,9 @@ GITEA_CUSTOM=/home/gitea/custom ./gitea web * `GOOS` * `GOARCH` -* [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable) +* [`GOPATH`](https://go.dev/cmd/go/#hdr-GOPATH_environment_variable) -您可以在[官方文档](https://golang.org/cmd/go/#hdr-Environment_variables)中查阅这些配置参数的详细信息。 +您可以在[官方文档](https://go.dev/cmd/go/#hdr-Environment_variables)中查阅这些配置参数的详细信息。 ## Gitea 的文件目录 diff --git a/docs/content/administration/mail-templates.en-us.md b/docs/content/administration/mail-templates.en-us.md index a129453e1a84..32b352da4b45 100644 --- a/docs/content/administration/mail-templates.en-us.md +++ b/docs/content/administration/mail-templates.en-us.md @@ -85,7 +85,7 @@ Text and macros for the mail body Specifying a _subject_ section is optional (and therefore also the dash line separator). When used, the separator between _subject_ and _mail body_ templates requires at least three dashes; no other characters are allowed in the separator line. -_Subject_ and _mail body_ are parsed by [Golang's template engine](https://golang.org/pkg/text/template/) and +_Subject_ and _mail body_ are parsed by [Golang's template engine](https://go.dev/pkg/text/template/) and are provided with a _metadata context_ assembled for each notification. The context contains the following elements: | Name | Type | Available | Usage | @@ -110,7 +110,7 @@ All names are case sensitive. ### The _subject_ part of the template -The template engine used for the mail _subject_ is golang's [`text/template`](https://golang.org/pkg/text/template/). +The template engine used for the mail _subject_ is golang's [`text/template`](https://go.dev/pkg/text/template/). Please refer to the linked documentation for details about its syntax. The _subject_ is built using the following steps: @@ -138,7 +138,7 @@ the two templates, even if a valid subject template is present. ### The _mail body_ part of the template -The template engine used for the _mail body_ is golang's [`html/template`](https://golang.org/pkg/html/template/). +The template engine used for the _mail body_ is golang's [`html/template`](https://go.dev/pkg/html/template/). Please refer to the linked documentation for details about its syntax. The _mail body_ is parsed after the mail subject, so there is an additional _metadata_ field which is @@ -146,7 +146,7 @@ the actual rendered subject, after all considerations. The expected result is HTML (including structural elements like``, ``, etc.). Styling through `