Skip to content

Commit 74b8c43

Browse files
committed
Bring over changes from master (latest commit 135c511)
1 parent 7402266 commit 74b8c43

39 files changed

+945
-363
lines changed

.github/workflows/echo.yml

+19-12
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
matrix:
2828
os: [ubuntu-latest, macos-latest, windows-latest]
2929
# Each major Go release is supported until there are two newer major releases. https://golang.org/doc/devel/release.html#policy
30-
# Echo tests with last four major releases
31-
# except v5 starts from 1.17 until there is last four major releases after that
32-
go: [1.17, 1.18]
30+
# Echo tests with last four major releases (unless there are pressing vulnerabilities)
31+
# As we depend on `golang.org/x/` libraries which only support last 2 Go releases we could have situations when
32+
# we derive from last four major releases promise.
33+
go: [1.17, 1.18, 1.19]
3334
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
3435
runs-on: ${{ matrix.os }}
3536
steps:
@@ -43,19 +44,23 @@ jobs:
4344
with:
4445
go-version: ${{ matrix.go }}
4546

46-
- name: Install Dependencies
47+
- name: Run Tests
48+
run: go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
49+
50+
- name: Install dependencies for checks
4751
run: |
4852
go install golang.org/x/lint/golint@latest
4953
go install honnef.co/go/tools/cmd/staticcheck@latest
5054
51-
- name: Run Tests
52-
run: |
53-
golint -set_exit_status ./...
54-
staticcheck ./...
55-
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
55+
- name: Run golint
56+
run: golint -set_exit_status ./...
57+
58+
- name: Run staticcheck
59+
run: staticcheck ./...
60+
5661
- name: Upload coverage to Codecov
57-
if: success() && matrix.go == 1.18 && matrix.os == 'ubuntu-latest'
58-
uses: codecov/codecov-action@v1
62+
if: success() && matrix.go == 1.19 && matrix.os == 'ubuntu-latest'
63+
uses: codecov/codecov-action@v3
5964
with:
6065
token:
6166
fail_ci_if_error: false
@@ -64,7 +69,7 @@ jobs:
6469
strategy:
6570
matrix:
6671
os: [ubuntu-latest]
67-
go: [1.18]
72+
go: [1.19]
6873
name: Benchmark comparison ${{ matrix.os }} @ Go ${{ matrix.go }}
6974
runs-on: ${{ matrix.os }}
7075
steps:
@@ -91,10 +96,12 @@ jobs:
9196
run: |
9297
cd previous
9398
go test -run="-" -bench=".*" -count=8 ./... > benchmark.txt
99+
94100
- name: Run Benchmark (New)
95101
run: |
96102
cd new
97103
go test -run="-" -bench=".*" -count=8 ./... > benchmark.txt
104+
98105
- name: Run Benchstat
99106
run: |
100107
benchstat previous/benchmark.txt new/benchmark.txt

CHANGELOG.md

+69
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
# Changelog
22

3+
4+
## v4.10.0 - 2022-xx-xx
5+
6+
**Security**
7+
8+
This minor version bumps minimum Go version to 1.17 (from 1.16) due `golang.org/x/` packages we depend on. There are
9+
several vulnerabilities fixed in these libraries.
10+
11+
Echo still tries to support last 4 Go versions but there are occasions we can not guarantee this promise.
12+
13+
14+
## v4.9.1 - 2022-10-12
15+
16+
**Fixes**
17+
18+
* Fix logger panicing (when template is set to empty) by bumping dependency version [#2295](https://github.com/labstack/echo/issues/2295)
19+
20+
**Enhancements**
21+
22+
* Improve CORS documentation [#2272](https://github.com/labstack/echo/pull/2272)
23+
* Update readme about supported Go versions [#2291](https://github.com/labstack/echo/pull/2291)
24+
* Tests: improve error handling on closing body [#2254](https://github.com/labstack/echo/pull/2254)
25+
* Tests: refactor some of the assertions in tests [#2275](https://github.com/labstack/echo/pull/2275)
26+
* Tests: refactor assertions [#2301](https://github.com/labstack/echo/pull/2301)
27+
28+
## v4.9.0 - 2022-09-04
29+
30+
**Security**
31+
32+
* Fix open redirect vulnerability in handlers serving static directories (e.Static, e.StaticFs, echo.StaticDirectoryHandler) [#2260](https://github.com/labstack/echo/pull/2260)
33+
34+
**Enhancements**
35+
36+
* Allow configuring ErrorHandler in CSRF middleware [#2257](https://github.com/labstack/echo/pull/2257)
37+
* Replace HTTP method constants in tests with stdlib constants [#2247](https://github.com/labstack/echo/pull/2247)
38+
39+
40+
## v4.8.0 - 2022-08-10
41+
42+
**Most notable things**
43+
44+
You can now add any arbitrary HTTP method type as a route [#2237](https://github.com/labstack/echo/pull/2237)
45+
```go
46+
e.Add("COPY", "/*", func(c echo.Context) error
47+
return c.String(http.StatusOK, "OK COPY")
48+
})
49+
```
50+
51+
You can add custom 404 handler for specific paths [#2217](https://github.com/labstack/echo/pull/2217)
52+
```go
53+
e.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })
54+
55+
g := e.Group("/images")
56+
g.RouteNotFound("/*", func(c echo.Context) error { return c.NoContent(http.StatusNotFound) })
57+
```
58+
59+
**Enhancements**
60+
61+
* Add new value binding methods (UnixTimeMilli,TextUnmarshaler,JSONUnmarshaler) to Valuebinder [#2127](https://github.com/labstack/echo/pull/2127)
62+
* Refactor: body_limit middleware unit test [#2145](https://github.com/labstack/echo/pull/2145)
63+
* Refactor: Timeout mw: rework how test waits for timeout. [#2187](https://github.com/labstack/echo/pull/2187)
64+
* BasicAuth middleware returns 500 InternalServerError on invalid base64 strings but should return 400 [#2191](https://github.com/labstack/echo/pull/2191)
65+
* Refactor: duplicated findStaticChild process at findChildWithLabel [#2176](https://github.com/labstack/echo/pull/2176)
66+
* Allow different param names in different methods with same path scheme [#2209](https://github.com/labstack/echo/pull/2209)
67+
* Add support for registering handlers for different 404 routes [#2217](https://github.com/labstack/echo/pull/2217)
68+
* Middlewares should use errors.As() instead of type assertion on HTTPError [#2227](https://github.com/labstack/echo/pull/2227)
69+
* Allow arbitrary HTTP method types to be added as routes [#2237](https://github.com/labstack/echo/pull/2237)
70+
71+
372
## v4.7.2 - 2022-03-16
473

574
**Fixes**

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ init:
1313
@go install honnef.co/go/tools/cmd/staticcheck@latest
1414

1515
lint: ## Lint the files
16+
@staticcheck ${PKG_LIST}
1617
@golint -set_exit_status ${PKG_LIST}
1718

1819
vet: ## Vet the files

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111

1212
## Supported Go versions
1313

14-
Echo supports last four major releases. `v5` starts from 1.16 until there is last four major releases after that.
14+
Latest version of Echo supports last four Go major [releases](https://go.dev/doc/devel/release) and might work with older versions.
1515

1616
As of version 4.0.0, Echo is available as a [Go module](https://github.com/golang/go/wiki/Modules).
1717
Therefore a Go version capable of understanding /vN suffixed imports is required:
1818

19-
- 1.9.7+
20-
- 1.10.3+
21-
- 1.16+
2219

2320
Any of these versions will allow you to import Echo as `github.com/labstack/echo/v4` which is the recommended
2421
way of using Echo going forward.
@@ -95,6 +92,7 @@ func hello(c echo.Context) error {
9592
| [github.com/brpaz/echozap](https://github.com/brpaz/echozap) | Uber´s [Zap](https://github.com/uber-go/zap) logging library wrapper for Echo logger interface. |
9693
| [github.com/darkweak/souin/plugins/echo](https://github.com/darkweak/souin/tree/master/plugins/echo) | HTTP cache system based on [Souin](https://github.com/darkweak/souin) to automatically get your endpoints cached. It supports some distributed and non-distributed storage systems depending your needs. |
9794
| [github.com/mikestefanello/pagoda](https://github.com/mikestefanello/pagoda) | Rapid, easy full-stack web development starter kit built with Echo. |
95+
| [github.com/go-woo/protoc-gen-echo](https://github.com/go-woo/protoc-gen-echo) | ProtoBuf generate Echo server side code |
9896

9997
Please send a PR to add your own library here.
10098

0 commit comments

Comments
 (0)