From 69c75a51a31618dbc8fcdb87805f65663c0ff7f3 Mon Sep 17 00:00:00 2001 From: Cory Jacobsen Date: Fri, 1 May 2026 20:50:49 +0000 Subject: [PATCH] chore: updating repo --- .github/workflows/lint.yaml | 4 ++-- .github/workflows/test.yaml | 6 +++--- .golangci.yaml | 31 ++----------------------------- README.md | 6 +++--- secure_test.go | 5 +++-- 5 files changed, 13 insertions(+), 39 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 008af37..bfe73e8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,9 +11,9 @@ jobs: golangci: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: path: src/github.com/unrolled/secure - - uses: golangci/golangci-lint-action@v6 + - uses: golangci/golangci-lint-action@v9 with: working-directory: src/github.com/unrolled/secure diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d3b9d04..c073272 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,12 +11,12 @@ jobs: tests: strategy: matrix: - go-version: [1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x] + go-version: [1.21.x, 1.22.x, 1.23.x, 1.24.x, 1.25.x, 1.26.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} - run: make ci diff --git a/.golangci.yaml b/.golangci.yaml index f9bbd25..656a9a0 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,32 +1,5 @@ +version: "2" + run: - timeout: 10m modules-download-mode: readonly allow-parallel-runners: true - -linters: - enable-all: true - disable: - - paralleltest - - gochecknoglobals - - exhaustruct - - wrapcheck - - tagliatelle - - depguard - - ireturn - - funlen - - varnamelen - - gomnd - - execinquery - - copyloopvar - - intrange - - gocognit - - lll - - cyclop - - gocyclo - - testpackage - - err113 - - nestif - - maintidx - - contextcheck - - perfsprint - - exportloopref diff --git a/README.md b/README.md index cf8b92d..236aa4a 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ s := secure.New(secure.Options{ FeaturePolicy: "vibrate 'none';", // Deprecated: this header has been renamed to PermissionsPolicy. FeaturePolicy allows the Feature-Policy header with the value to be set with a custom value. Default is "". PermissionsPolicy: "fullscreen=(), geolocation=()", // PermissionsPolicy allows the Permissions-Policy header with the value to be set with a custom value. Default is "". CrossOriginOpenerPolicy: "same-origin", // CrossOriginOpenerPolicy allows the Cross-Origin-Opener-Policy header with the value to be set with a custom value. Default is "". - CrossOriginEmbedderPolicy: "require-corp", // CrossOriginEmbedderPolicy allows the Cross-Origin-Embedder-Policy header with the value to be set with a custom value. Default is "". - CrossOriginResourcePolicy: "same-origin", // CrossOriginResourcePolicy allows the Cross-Origin-Resource-Policy header with the value to be set with a custom value. Default is "". - XDNSPrefetchControl: "on", // XDNSPrefetchControl allows the X-DNS-Prefetch-Control header to be set via "on" or "off" keyword. Default is "". + CrossOriginEmbedderPolicy: "require-corp", // CrossOriginEmbedderPolicy allows the Cross-Origin-Embedder-Policy header with the value to be set with a custom value. Default is "". + CrossOriginResourcePolicy: "same-origin", // CrossOriginResourcePolicy allows the Cross-Origin-Resource-Policy header with the value to be set with a custom value. Default is "". + XDNSPrefetchControl: "on", // XDNSPrefetchControl allows the X-DNS-Prefetch-Control header to be set via "on" or "off" keyword. Default is "". XPermittedCrossDomainPolicies: "none", // XPermittedCrossDomainPolicies allows the X-Permitted-Cross-Domain-Policies to be set with a custom value. Default is "". IsDevelopment: true, // This will cause the AllowedHosts, SSLRedirect, and STSSeconds/STSIncludeSubdomains options to be ignored during development. When deploying to production, be sure to set this to false. }) diff --git a/secure_test.go b/secure_test.go index 0411d94..c9aabc9 100644 --- a/secure_test.go +++ b/secure_test.go @@ -319,9 +319,10 @@ func TestBasicSSLWithHostFunc(t *testing.T) { sslHostFunc := (func() SSLHostFunc { return func(host string) string { newHost := "" - if host == exampleHost { + switch host { + case exampleHost: newHost = "secure.example.com:8443" - } else if host == "www.example.org" { + case "www.example.org": newHost = "secure.example.org" }