Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: labstack/echo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.11.4
Choose a base ref
...
head repository: labstack/echo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.12.0
Choose a head ref

Commits on Dec 20, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    60fc2fb View commit details

Commits on Jan 23, 2024

  1. README.md: add Encore as sponsor (#2579)

    There wasn't a sponsors section so I had to design one, hope you think it makes sense.
    marcuskohlberg authored Jan 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d262120 View commit details

Commits on Jan 24, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b835498 View commit details

Commits on Jan 28, 2024

  1. CI: upgrade actions/checkout to v4 and actions/setup-go to v5 (#2584)

    * CI: upgrade actions/checkout to v4
    * CI: upgrade actions/setup-go to v5
    aldas authored Jan 28, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f12fdb0 View commit details

Commits on Feb 6, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    76994d1 View commit details

Commits on Feb 7, 2024

  1. CI: Use Go 1.22

    aldas committed Feb 7, 2024
    Copy the full SHA
    51c54f4 View commit details
  2. In Go 1.22 finding name of function with reflection has changed. chan…

    …ge tests to work with that.
    aldas committed Feb 7, 2024
    Copy the full SHA
    29aab27 View commit details

Commits on Feb 13, 2024

  1. binder: allow binding to a nil map

    georgmu authored and aldas committed Feb 13, 2024
    Copy the full SHA
    ea529bb View commit details

Commits on Feb 18, 2024

  1. Add Skipper Unit Test In BasicBasicAuthConfig and Add More Detail Exp…

    …lanation regarding BasicAuthValidator (#2461)
    
    * Add Skipper Unit Test In BasicBasicAuthConfig and Add More detail explanation regarding BasicAuthValidator
    
    * Simplify Skipper Unit Test
    RyoKusnadi authored Feb 18, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fa70db8 View commit details

Commits on Mar 6, 2024

  1. fix some typos (#2603)

    Signed-off-by: teslaedison <qingchengqiushuang@gmail.com>
    teslaedison authored Mar 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    34717b7 View commit details
  2. fix: some typos (#2596)

    pomadev authored Mar 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3e04e3e View commit details

Commits on Mar 9, 2024

  1. Allow ResponseWriters to unwrap writers when flushing/hijacking (#2595)

    * Allow ResponseWriters to unwrap writers when flushing/hijacking
    aldas authored Mar 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    bc1e190 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a842444 View commit details
  3. Upgrade deps

    aldas committed Mar 9, 2024
    Copy the full SHA
    f096679 View commit details
  4. update makefile

    aldas committed Mar 9, 2024
    Copy the full SHA
    5f7bedf View commit details
  5. Change type definition blocks to single declarations. This helps copy…

    …/pasting Echo code in examples. (#2606)
    aldas authored Mar 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3598f29 View commit details

Commits on Mar 10, 2024

  1. Fix Real IP logic (#2550)

    * Fix realIP logic
    cl-bvl authored Mar 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a3b0ba2 View commit details

Commits on Mar 11, 2024

  1. Default binder can use UnmarshalParams(params []string) error inter…

    …face to bind multiple input values at one go. (#2607)
    aldas authored Mar 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c57fcb3 View commit details

Commits on Mar 13, 2024

  1. default binder can bind pointer to slice as struct field. For example…

    … `*[]string` (#2608)
    aldas authored Mar 13, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    011acb4 View commit details

Commits on Mar 21, 2024

  1. Remove maxparam dependence from Context (#2611)

    aldas authored Mar 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d549290 View commit details

Commits on Mar 27, 2024

  1. When route is registered with empty path it is normalized to /. Mak…

    …e sure that returned echo.Route structs reflect that behavior. (#2616)
    aldas authored Mar 27, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    447c92d View commit details

Commits on Apr 15, 2024

  1. Update golang.org/x/* deps (#2625)

    aldas authored Apr 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3062025 View commit details
  2. proxy middleware should use http proxy for SSE requests (#2624)

    aldas authored Apr 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e0f2a02 View commit details
  3. Changelog for v4.12.0 (#2626)

    aldas authored Apr 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    88c379f View commit details
Showing with 2,659 additions and 1,663 deletions.
  1. +3 −3 .github/workflows/checks.yml
  2. +7 −7 .github/workflows/echo.yml
  3. +31 −0 CHANGELOG.md
  4. +2 −2 Makefile
  5. +20 −13 README.md
  6. +100 −48 bind.go
  7. +518 −130 bind_test.go
  8. +3 −0 binder.go
  9. +3 −0 binder_external_test.go
  10. +3 −0 binder_test.go
  11. +166 −155 context.go
  12. +3 −0 context_fs.go
  13. +3 −0 context_fs_test.go
  14. +49 −34 context_test.go
  15. +128 −123 echo.go
  16. +3 −0 echo_fs.go
  17. +3 −0 echo_fs_test.go
  18. +14 −8 echo_test.go
  19. +3 −3 go.mod
  20. +6 −6 go.sum
  21. +13 −12 group.go
  22. +3 −0 group_fs.go
  23. +3 −0 group_fs_test.go
  24. +3 −0 group_test.go
  25. +13 −4 ip.go
  26. +29 −19 ip_test.go
  27. +3 −0 json.go
  28. +3 −0 json_test.go
  29. +35 −35 log.go
  30. +23 −22 middleware/basic_auth.go
  31. +19 −1 middleware/basic_auth_test.go
  32. +31 −24 middleware/body_dump.go
  33. +53 −0 middleware/body_dump_test.go
  34. +21 −22 middleware/body_limit.go
  35. +3 −0 middleware/body_limit_test.go
  36. +47 −46 middleware/compress.go
  37. +33 −0 middleware/compress_test.go
  38. +3 −0 middleware/context_timeout.go
  39. +3 −0 middleware/context_timeout_test.go
  40. +105 −106 middleware/cors.go
  41. +3 −0 middleware/cors_test.go
  42. +70 −71 middleware/csrf.go
  43. +3 −0 middleware/csrf_test.go
  44. +15 −16 middleware/decompress.go
  45. +4 −1 middleware/decompress_test.go
  46. +3 −0 middleware/extractor.go
  47. +3 −0 middleware/extractor_test.go
  48. +123 −124 middleware/jwt.go
  49. +3 −0 middleware/jwt_test.go
  50. +54 −55 middleware/key_auth.go
  51. +3 −0 middleware/key_auth_test.go
  52. +69 −70 middleware/logger.go
  53. +3 −0 middleware/logger_test.go
  54. +18 −19 middleware/method_override.go
  55. +3 −0 middleware/method_override_test.go
  56. +9 −8 middleware/middleware.go
  57. +49 −0 middleware/middleware_test.go
  58. +104 −106 middleware/proxy.go
  59. +3 −0 middleware/proxy_test.go
  60. +45 −48 middleware/rate_limiter.go
  61. +3 −0 middleware/rate_limiter_test.go
  62. +47 −48 middleware/recover.go
  63. +3 −0 middleware/recover_test.go
  64. +3 −0 middleware/redirect.go
  65. +3 −0 middleware/redirect_test.go
  66. +21 −22 middleware/request_id.go
  67. +3 −0 middleware/request_id_test.go
  68. +3 −0 middleware/request_logger.go
  69. +4 −1 middleware/request_logger_test.go
  70. +44 −0 middleware/responsecontroller_1.19.go
  71. +20 −0 middleware/responsecontroller_1.20.go
  72. +27 −28 middleware/rewrite.go
  73. +3 −0 middleware/rewrite_test.go
  74. +76 −77 middleware/secure.go
  75. +3 −0 middleware/secure_test.go
  76. +15 −16 middleware/slash.go
  77. +3 −0 middleware/slash_test.go
  78. +40 −41 middleware/static.go
  79. +3 −0 middleware/static_other.go
  80. +3 −0 middleware/static_test.go
  81. +3 −0 middleware/static_windows.go
  82. +9 −8 middleware/timeout.go
  83. +3 −0 middleware/timeout_test.go
  84. +3 −0 middleware/util.go
  85. +3 −0 middleware/util_test.go
  86. +21 −16 response.go
  87. +28 −0 response_test.go
  88. +44 −0 responsecontroller_1.19.go
  89. +20 −0 responsecontroller_1.20.go
  90. +78 −65 router.go
  91. +19 −0 router_test.go
6 changes: 3 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -14,17 +14,17 @@ permissions:

env:
# run static analysis only with the latest Go version
LATEST_GO_VERSION: "1.21"
LATEST_GO_VERSION: "1.22"

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.LATEST_GO_VERSION }}
check-latest: true
14 changes: 7 additions & 7 deletions .github/workflows/echo.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ permissions:

env:
# run coverage and benchmarks only with the latest Go version
LATEST_GO_VERSION: "1.21"
LATEST_GO_VERSION: "1.22"

jobs:
test:
@@ -25,15 +25,15 @@ jobs:
# Echo tests with last four major releases (unless there are pressing vulnerabilities)
# As we depend on `golang.org/x/` libraries which only support last 2 Go releases we could have situations when
# we derive from last four major releases promise.
go: ["1.18", "1.19", "1.20", "1.21"]
go: ["1.19", "1.20", "1.21", "1.22"]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

@@ -53,18 +53,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code (Previous)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
path: previous

- name: Checkout Code (New)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: new

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.LATEST_GO_VERSION }}

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## v4.12.0 - 2024-04-15

**Security**

* Update golang.org/x/net dep because of [GO-2024-2687](https://pkg.go.dev/vuln/GO-2024-2687) by @aldas in https://github.com/labstack/echo/pull/2625


**Enhancements**

* binder: make binding to Map work better with string destinations by @aldas in https://github.com/labstack/echo/pull/2554
* README.md: add Encore as sponsor by @marcuskohlberg in https://github.com/labstack/echo/pull/2579
* Reorder paragraphs in README.md by @aldas in https://github.com/labstack/echo/pull/2581
* CI: upgrade actions/checkout to v4 by @aldas in https://github.com/labstack/echo/pull/2584
* Remove default charset from 'application/json' Content-Type header by @doortts in https://github.com/labstack/echo/pull/2568
* CI: Use Go 1.22 by @aldas in https://github.com/labstack/echo/pull/2588
* binder: allow binding to a nil map by @georgmu in https://github.com/labstack/echo/pull/2574
* Add Skipper Unit Test In BasicBasicAuthConfig and Add More Detail Explanation regarding BasicAuthValidator by @RyoKusnadi in https://github.com/labstack/echo/pull/2461
* fix some typos by @teslaedison in https://github.com/labstack/echo/pull/2603
* fix: some typos by @pomadev in https://github.com/labstack/echo/pull/2596
* Allow ResponseWriters to unwrap writers when flushing/hijacking by @aldas in https://github.com/labstack/echo/pull/2595
* Add SPDX licence comments to files. by @aldas in https://github.com/labstack/echo/pull/2604
* Upgrade deps by @aldas in https://github.com/labstack/echo/pull/2605
* Change type definition blocks to single declarations. This helps copy… by @aldas in https://github.com/labstack/echo/pull/2606
* Fix Real IP logic by @cl-bvl in https://github.com/labstack/echo/pull/2550
* Default binder can use `UnmarshalParams(params []string) error` inter… by @aldas in https://github.com/labstack/echo/pull/2607
* Default binder can bind pointer to slice as struct field. For example `*[]string` by @aldas in https://github.com/labstack/echo/pull/2608
* Remove maxparam dependence from Context by @aldas in https://github.com/labstack/echo/pull/2611
* When route is registered with empty path it is normalized to `/`. by @aldas in https://github.com/labstack/echo/pull/2616
* proxy middleware should use httputil.ReverseProxy for SSE requests by @aldas in https://github.com/labstack/echo/pull/2624


## v4.11.4 - 2023-12-20

**Security**
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -31,6 +31,6 @@ benchmark: ## Run benchmarks
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

goversion ?= "1.17"
test_version: ## Run tests inside Docker with given version (defaults to 1.17 oldest supported). Example: make test_version goversion=1.17
goversion ?= "1.19"
test_version: ## Run tests inside Docker with given version (defaults to 1.19 oldest supported). Example: make test_version goversion=1.19
@docker run --rm -it -v $(shell pwd):/project golang:$(goversion) /bin/sh -c "cd /project && make init check"
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,20 +9,18 @@
[![Twitter](https://img.shields.io/badge/twitter-@labstack-55acee.svg?style=flat-square)](https://twitter.com/labstack)
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/labstack/echo/master/LICENSE)

## Supported Go versions
## Echo

Latest version of Echo supports last four Go major [releases](https://go.dev/doc/devel/release) and might work with
older versions.
High performance, extensible, minimalist Go web framework.

As of version 4.0.0, Echo is available as a [Go module](https://github.com/golang/go/wiki/Modules).
Therefore a Go version capable of understanding /vN suffixed imports is required:
* [Official website](https://echo.labstack.com)
* [Quick start](https://echo.labstack.com/docs/quick-start)
* [Middlewares](https://echo.labstack.com/docs/category/middleware)

Any of these versions will allow you to import Echo as `github.com/labstack/echo/v4` which is the recommended
way of using Echo going forward.
Help and questions: [Github Discussions](https://github.com/labstack/echo/discussions)

For older versions, please use the latest v3 tag.

## Feature Overview
### Feature Overview

- Optimized HTTP router which smartly prioritize routes
- Build robust and scalable RESTful APIs
@@ -38,6 +36,18 @@ For older versions, please use the latest v3 tag.
- Automatic TLS via Let’s Encrypt
- HTTP/2 support

## Sponsors

<div>
<a href="https://encore.dev" style="display: inline-flex; align-items: center; gap: 10px">
<img src="https://user-images.githubusercontent.com/78424526/214602214-52e0483a-b5fc-4d4c-b03e-0b7b23e012df.svg" height="28px" alt="encore icon"></img>
<b>Encore – the platform for building Go-based cloud backends</b>
</a>
</div>
<br/>

Click [here](https://github.com/sponsors/labstack) for more information on sponsorship.

## Benchmarks

Date: 2020/11/11<br>
@@ -57,6 +67,7 @@ The benchmarks above were run on an Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
// go get github.com/labstack/echo/{version}
go get github.com/labstack/echo/v4
```
Latest version of Echo supports last four Go major [releases](https://go.dev/doc/devel/release) and might work with older versions.

### Example

@@ -117,10 +128,6 @@ of middlewares in this list.

Please send a PR to add your own library here.

## Help

- [Forum](https://github.com/labstack/echo/discussions)

## Contribute

**Use issues for everything**
Loading