1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00
Commit Graph

1368 Commits

Author SHA1 Message Date
Roland Lammel
d3245067e0
Merge pull request #1559 from flimzy/wrapper
Extend HTTPError to satisfy the Go 1.13 error wrapper interface
2020-07-23 21:51:54 +02:00
Roland Lammel
7533c6984b
Merge pull request #1558 from iwamot/testafter
Add test for 'func (*Response) After'
2020-07-20 18:00:17 +02:00
Roland Lammel
165648d4a0
Merge pull request #1607 from BUGLAN/fix/dupl
Fix duplicate code for applyMiddleware
2020-07-20 13:45:57 +02:00
Roland Lammel
a151cbb677
Merge pull request #1613 from cathy812/master
dependency package golang.org/x/text v0.3.2 has high security vulnera…
2020-07-20 13:39:55 +02:00
cathy zhang
c4118c049e dependency package golang.org/x/text v0.3.2 has high security vulnerabiliy, upgrade it to v0.3.3 2020-07-20 14:01:21 +08:00
buglan
546639c8d0 Fix duplicate code 2020-07-08 20:17:34 +08:00
Masahiro Furudate
e125b2cf84
Fix recover print stack trace log level (#1604)
* Fix recover print stack trace log level

* Add recover log level test

* Add default LogLevel to DefaultRecoverConfig
2020-07-06 07:59:42 -07:00
roz3x
de3a2d4df3
changed guide highlighting to shell (#1593) 2020-06-30 21:08:30 -07:00
Roland Lammel
43e32ba83d
Fix #1526 trailing slash to any route (#1563)
* refs #1526: Add tests for trailing slash requests with nested any routes

* refs #1526: Handle specual router case with trailing slash for non-root any route

* refs #1526: Fix accidential lookup for any route without trailing slash in request
2020-05-06 14:01:28 -07:00
Jonathan Hall
ea34bf9441 Add tests for HTTPError.Unwrap 2020-05-05 16:32:38 +02:00
Jonathan Hall
803c4f673b Extend HTTPError to satisfy the Go 1.13 error wrapper interface 2020-04-29 16:13:30 +02:00
Takashi Iwamoto
4aebe68f37 Add test for 'func (*Response) After' 2020-04-26 22:09:10 +09:00
Lars Lehtonen
c08f30359b
test matrix add go1.14 (#1551)
test matrix deprecate go1.11
2020-04-25 11:01:54 -07:00
Takashi Iwamoto
a8b5de4286
Add test case for Response (#1557) 2020-04-25 11:01:03 -07:00
Ori Shoshan
c29904d81c
Fixed double padding in Group.File, Group.Add (#1534)
Group.File was padding with g.prefix even though it would later call Group.Add which padded with prefix again - for a total of two times
2020-04-25 10:58:16 -07:00
Arun Gopalpuri
2207c37bf8
use echo.GetPath for rewrite in proxy (#1548)
Co-authored-by: Arun Gopalpuri <arun@gopalpuri.com>
2020-04-08 08:19:22 -07:00
Vishal Rana
6e7c7cea03 Bumped version
Signed-off-by: Vishal Rana <vr@labstack.com>
2020-03-30 12:32:58 -07:00
178inaba
269dfcc9dd
Set maxParam with SetParamNames (#1535)
* Set maxParam with SetParamNames

Fixes #1492

* Revert go.mod
2020-03-30 12:28:07 -07:00
Leaf
542835808e
Quote regex meta characters in Rewrite (#1541)
Currently there is a half and half situation where the user can't use regex (fully) because * will be replaced with (.*), yet they also can't just enter any old string, because meta chars like . would need escaping.

e.g. currently *.html wouldn't work as intended, and instead *\.html should be used.

Work around this by using regexp's QuoteMeta function to sanitise the input before handling it.
2020-03-28 17:12:39 -07:00
Vishal Rana
fc4b1c0a83
Omit internal=<nil> in error strings (#1525) 2020-03-05 06:36:43 -08:00
Vishal Rana
3e8a797db0 Updated version
Signed-off-by: Vishal Rana <vr@labstack.com>
2020-02-29 07:49:22 -08:00
lukesolo
84b8aaf24f
Fix panic in FormFile if file not found (#1515) 2020-02-29 07:46:25 -08:00
Vishal Rana
91b853a6f2 Updated go.mod
Signed-off-by: Vishal Rana <vr@labstack.com>
2020-02-29 07:25:32 -08:00
Shinichi TAMURA
7c5af01350
Safer/trustable extraction of real ip from request (#1478)
* Safer/trustable extraction of real ip from request

* Fix x-real-ip handling on proxy

* fix docs

* fix default check
2020-02-24 08:29:34 -08:00
Roland Lammel
5ddc3a68ba
Fix routing conflict for dynamic routes and static route with common prefix (#1509) (#1512)
* Add test for issue #1509 for dynamic routes and multiple static routes with common prefix

* Fix #1509: routing conflict for dynamic routes and static route with common prefix

* Improve routing performance for static only route trees
2020-02-24 08:26:49 -08:00
Roland Lammel
f4b5a90ad3
Fix #1493 router loop for param routes (#1501)
* Add test to reproduce router loop for #1493

* Simplify and correct  router param tests

* Fix #1493 to avoid router loop for param nodes
2020-02-19 07:10:57 -08:00
Jur van den Berg
504f39abaf
Fix crash on OpenBSD due to unsupported TCP KeepAlivePeriod (#1456) 2020-02-03 10:09:27 -08:00
Ajitem Sahasrabuddhe
75620e6767
Migrate to GitHub Actions (#1473)
* add workflow yml

* fix syntax error

* update test command
2020-01-28 19:24:22 -08:00
sai umesh
7c58856fb4
added installation command in guide (#1443)
* added installation command in guide

* fixed lints
2020-01-28 19:23:29 -08:00
ochan
c2f2e8d258
Support HTTP/2 h2c mode (cleartext) (#1489) 2020-01-28 14:46:00 -08:00
Dmitry Kutakov
712b5e46c5 format code (gofmt + trim trailing space) (#1452) 2020-01-25 09:48:53 -08:00
J. David Lowe
8d7f05e533 round-trip paramValues without exploding (#1463) 2020-01-23 18:32:17 -08:00
Ajitem Sahasrabuddhe
5bf6888444 Parameterized routes sometimes return 404 (#1480)
* url param bug

* add comment

* add tests

* Bump echo version
2020-01-23 16:13:18 -08:00
Eugene
399da56370 Improve bind performance (#1469)
* Improve bind performance

By some slight optimisations and lesser reflect usage now binding has significantly better performance:

name                    old time/op    new time/op    delta
BindbindData-8            21.2µs ± 2%    13.5µs ± 2%  -36.66%  (p=0.000 n=16+18)
BindbindDataWithTags-8    22.1µs ± 1%    16.4µs ± 2%  -26.03%  (p=0.000 n=20+20)

name                    old alloc/op   new alloc/op   delta
BindbindData-8            2.40kB ± 0%    1.33kB ± 0%  -44.64%  (p=0.000 n=20+20)
BindbindDataWithTags-8    2.31kB ± 0%    1.54kB ± 0%  -33.19%  (p=0.000 n=20+20)

name                    old allocs/op  new allocs/op  delta
BindbindData-8               297 ± 0%       122 ± 0%  -58.92%  (p=0.000 n=20+20)
BindbindDataWithTags-8       267 ± 0%       125 ± 0%  -53.18%  (p=0.000 n=20+20)

* Remove creation of new value in unmarshalFieldNonPtr
2020-01-08 13:40:52 -08:00
Roland Lammel
94d9e009d8 Tidy up unused imports from go.mod (#1468) 2020-01-08 10:53:02 -08:00
Ajitem Sahasrabuddhe
5793765eed Fix param value bug (#1467)
* set parameter value in the pvalues slice

* update echo version

* update travis yml to fix failing build and add go modules support

* Add tests

* Update router_test.go

Co-authored-by: Vishal Rana <vr@labstack.com>
2020-01-01 08:57:00 -08:00
Vishal Rana
07ec791103 Updated deps
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-12-29 23:08:27 -08:00
Vishal Rana
a64188c609 Merge branch 'neotel-at-bugfix/1412-route-matchany-multilevel' 2019-12-29 23:07:38 -08:00
Vishal Rana
8f69b47891 Merge branch 'bugfix/1412-route-matchany-multilevel' of https://github.com/neotel-at/echo into neotel-at-bugfix/1412-route-matchany-multilevel 2019-12-29 23:06:59 -08:00
Roland Lammel
8bfed69571 Run go mod tidy 2019-12-27 16:43:06 +01:00
Roland Lammel
86b200fa0d Merge branch 'bugfix/1412-route-matchany-multilevel' of github.com:neotel-at/echo into bugfix/1412-route-matchany-multilevel 2019-12-27 16:41:31 +01:00
Alex Besogonov
5c7c87d09e Add ability to set the logger on echo.Context (#1377)
This change allows middleware to replace the logger on the echo.Context
with a customized per-request logger with additional fields. The logger
is reset to default on every Reset() call.
2019-11-11 12:34:13 -08:00
Vishal Rana
c50c67783f Fixed #1426
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-10-30 19:01:23 -07:00
Shin Ohno
8b7220f97c Fixed comment typo in BodyDump (#1431) 2019-10-30 17:34:27 -07:00
Vishal Rana
7c5e9ab0d9 Fixed #988
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-10-24 14:59:52 -07:00
Argishti Rostamian
754b44989f Close file descriptor returned by request.FormFile (#1411) 2019-10-24 11:52:14 -07:00
Mark Smith
ee6618e831 reset p.values to echo.maxParam (#1429)
* reset p.values to echo.maxParam
* Update context.go

How about just reset the values?
2019-10-24 10:48:56 -07:00
Roland Lammel
ccf6f1a77d refs #1412: Fix parent nodes for route insert on node split 2019-10-16 22:35:30 +02:00
Roland Lammel
616db6dbad Add unrelated route to group test with match any 2019-10-16 22:35:30 +02:00
Roland Lammel
59a25f13bb Add tests for group routing with middleware and match any routes 2019-10-16 22:35:30 +02:00