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

1387 Commits

Author SHA1 Message Date
Pablo Andres Fuente
85e521f384 Fixed panic when Router#Find fails on Param paths
Fixed panic when Router#Find fails to find a route that could match a
Param route that only have children routes and no root route.
e.g
/create
/:id/edit
/:id/active

Finding /creates results in panic because the router tree node that
belongs to the param route :id don't have pnames on it. The childrens of
:id (:id/edit and :id/active) have the pnames properly set, but those
are not processed because /creates don't match on those paths.
2020-10-25 04:14:15 +00:00
Roland Lammel
151ed6b3f1
Merge pull request #1636 from pofl/patch-1
Update godoc link in README to /v4
2020-09-14 18:12:41 +02:00
Roland Lammel
0fd6fce45f
Merge pull request #1632 from imxyb/hardcode_for_http
Use http constants instead of hardcoded status
2020-09-14 18:10:42 +02:00
yonbiaoxiao
5c5c83d290 change the hardcode for http constant 2020-09-14 10:23:54 +08:00
Florian Polster
bfbab25044
Update godoc link in README to /v4 2020-09-12 10:47:03 +02:00
Roland Lammel
28ec3f7bdb
Merge pull request #1627 from juanbelieni/master
Create ErrJWTInvalid to allow modify error when JWT is invalid
2020-09-01 16:10:16 +02:00
Roland Lammel
2d79ff3d6c
Merge pull request #1628 from arun0009/master
set raw path and path in proxy, so url.EscapePath uses raw path
2020-09-01 16:03:30 +02:00
Roland Lammel
cf2fcad01b
Merge pull request #1588 from choyri/bugfix/rewrite
Fixes the uses of caret(^) in rewrite regex
2020-09-01 13:22:01 +02:00
Roland Lammel
bcb316500e
Merge pull request #1623 from KlotzAndrew/cors_regex
cors allow regex pattern
2020-09-01 13:20:23 +02:00
Arun Gopalpuri
1a6ec73e57 using url.EscapedPath instead of custom GetPath, rewritePath func added to middleware - used by proxy and rewrite 2020-08-31 13:09:24 -07:00
Vishal Rana
cb84205219 Bumped version
Signed-off-by: Vishal Rana <vr@labstack.com>
2020-08-27 20:09:25 -07:00
风吹过
28020c2a47
The directory path does not end with '/', it needs to be redirected (#1572)
* The directory path does not end with '/', it needs to be redirected

* changed guide highlighting to shell (#1593)

* 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

Co-authored-by: solym <ymwh@foxmai.com>
Co-authored-by: roz3x <52892437+roz3x@users.noreply.github.com>
Co-authored-by: Masahiro Furudate <178inaba.git@gmail.com>
2020-08-27 17:53:48 -07:00
Peter C
6463bcb190
added ModifyResponse option to ProxyConfig (#1622)
Co-authored-by: Peter C <petoc@users.noreply.github.com>
2020-08-27 17:51:27 -07:00
Juan Belieni
09f36b585d Create ErrJWTInvalid variable 2020-08-27 19:35:45 -03:00
Andrew Klotz
9a28fb8608
cors allow regex pattern
enable cors to use regex pattern for allowed origins

implementation is similar to another popular cors
middleware: https://github.com/astaxie/beego/blob/master/plugins/cors/cors.go#L196-L201
2020-08-19 03:17:12 +00:00
Shinnosuke Sawada
8dd25c39ce
make gzipResponseWriter implement http.Pusher (#1615) 2020-08-03 17:58:08 -07:00
chotow
3dbd5dcf6e
Fixes the uses of caret(^) at the beginning of the rewrite regex 2020-07-24 23:37:01 +08:00
chotow
68e8bce645
Revert "Fixes the uses of caret(^) in rewrite regex"
This reverts commit 1f51469436e3612e8e121413df905dc9f4ffed0b.
2020-07-24 23:37:01 +08:00
chotow
84da507a2e
Fixes the uses of caret(^) in rewrite regex 2020-07-24 23:37:01 +08:00
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