1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-28 08:38:39 +02:00
Commit Graph

85 Commits

Author SHA1 Message Date
Letian Zhang
8cabd1e123 don't make router parse duplicated param when backtracing happens #1368 (#1369) 2019-07-25 13:39:03 -07:00
Vishal Rana
207a141d5d Closed #1348
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-07-17 21:18:56 -07:00
Michał Adamski
e1d21a73cf tests and fix for findChildByKind executed on nil node 2019-03-01 08:27:11 +01:00
Emir Ribić
c8fd197fa8 Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET (#1205) 2018-10-14 20:46:58 +05:30
Shogo Nagasaka
af5c97715f Fix node's parameter names assignment problem. (#1201) 2018-10-07 08:34:30 +05:30
Vishal Rana
7c3df7703f Revert "Allow parameter routes to end with a dot (/foo/:id.json)"
This reverts commit bfa14633f3.
2018-04-11 22:34:26 -07:00
Martin Tournoij
bfa14633f3 Allow parameter routes to end with a dot (/foo/:id.json)
Currently a route in the form of `/foo/:id.json` means echo will detect
the parameter name `id.json` instead of the expected `id`. I think this
is rather counter-intuitive, as adding an extension to paths is a fairly
common use case.

With this change both a `/` and a `.` will be treated as the end of a
parameter name.

Benchmark before this change:

	$ go test -bench .
	[..]

	goos: linux
	goarch: amd64
	pkg: github.com/labstack/echo
	BenchmarkRouterStaticRoutes-4             100000             17743 ns/op               0 B/op          0 allocs/op
	BenchmarkRouterGitHubAPI-4                 50000             33081 ns/op               1 B/op          0 allocs/op
	BenchmarkRouterParseAPI-4                 300000              5370 ns/op               0 B/op          0 allocs/op
	BenchmarkRouterGooglePlusAPI-4            200000              9183 ns/op               0 B/op          0 allocs/op
	PASS
	ok      github.com/labstack/echo        8.565s

After this change:

	goos: linux
	goarch: amd64
	pkg: github.com/labstack/echo
	BenchmarkRouterStaticRoutes-4             100000             17699 ns/op               0 B/op          0 allocs/op
	BenchmarkRouterGitHubAPI-4                 50000             32962 ns/op               1 B/op          0 allocs/op
	BenchmarkRouterParseAPI-4                 300000              5450 ns/op               0 B/op          0 allocs/op
	BenchmarkRouterGooglePlusAPI-4            200000              9205 ns/op               0 B/op          0 allocs/op
	PASS
	ok      github.com/labstack/echo        8.590s

Fixes #599
2018-04-10 11:37:35 -07:00
Vishal Rana
687f05470a Zhaojkun httperror message (#959)
* Change echo http error message

* Add test case

* Fixed test cases

Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-20 08:58:53 -07:00
Vishal Rana
1b70cbebbe Fixed #954
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-14 16:30:53 -07:00
Vishal Rana
f9e97332f3 fixed #729
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-11-15 20:12:13 -08:00
Vishal Rana
c5a3575d4c updated migration guide
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-11-14 22:54:09 -08:00
Vishal Rana
0fca54f389 updated docs, readme and benchmark tests
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-11-12 09:47:49 -08:00
Vishal Rana
954efac63a fixed #684
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-22 15:18:55 -07:00
Vishal Rana
36251e88e2 router changes
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-21 20:36:49 -07:00
Vishal Rana
2bdbf6918e fixed #623
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-14 14:52:40 -07:00
Vishal Rana
2eb87f8036 param wildcard capture fixed to *
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-10 18:36:48 -07:00
Vishal Rana
8623669cbc removed Context#P()
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-10 18:22:13 -07:00
Vishal Rana
15eb5b0aad removed embedded context and exposed SetRequest in context
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-10 17:31:26 -07:00
Vishal Rana
09a2ce60a6 About context #500
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-06-05 13:47:59 -07:00
Vishal Rana
682a5580b7 Deprecated Echo#GetContext() => Echo#AcquireContext(), Echo#PutContext() => Echo#ReleaseContext()
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-05-03 17:23:31 -07:00
Vishal Rana
467cf05b41 Changes based on comments for #430
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-16 15:56:09 -07:00
Vishal Rana
33700bfcc2 Fixed #457
- Dropped static middleware in favor of Echo#Static & Echo#StaticConfig.
- Enhanced middleware chaining.

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-09 14:00:23 -07:00
Vishal Rana
b5d6c05101 Fixed #441, #294
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-02 14:24:51 -07:00
Vishal Rana
7cf31b3b68 dummy
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-18 08:47:03 -07:00
Vishal Rana
3946a1839c New API Echo#GetContext & Echo#PutContext.
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-17 21:49:06 -07:00
Vishal Rana
09f3d3061f Closes #314
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-11 07:53:54 -08:00
Vishal Rana
4f08fed018 Fixed #378
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-06 23:24:51 -08:00
Vishal Rana
d5ba76ed81 Router fix, #217, #371, #372.
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-03 22:06:47 -08:00
Vishal Rana
51acf465fe - Moved static file serving to a new handler package
- Middleware at route level
- Group middleware is a in closure now

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-15 08:11:29 -08:00
Vishal Rana
0731959a98 Object method to get real object
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-08 16:48:03 -08:00
Vishal Rana
f405794a7c Now using sync.Pool
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-04 14:40:08 -08:00
Vishal Rana
dbd1e8e230 Separated recipes from the main repo
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-01-09 11:00:13 -08:00
Vishal Rana
0884290766 Added X() method to return context
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-12-04 08:13:26 -08:00
Vishal Rana
72459fe299 Step towards v2
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-12-03 17:23:53 -08:00
Vishal Rana
51f118b0ee Refactored variable type to kind
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-10-07 15:10:40 -07:00
Vishal Rana
5b019c507e Handling 405 & pre-flight requests
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-10-06 06:48:33 -07:00
Vishal Rana
c9a581815a Fixed #210
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-09-17 08:18:58 -07:00
Vishal Rana
853e650ee2 Fixed #207
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-09-16 19:37:37 -07:00
Vishal Rana
f251eead67 Fixed #184
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-09-15 08:29:29 -07:00
Vishal Rana
d077efe91a Fixed #162
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-07-27 08:43:11 -07:00
Vishal Rana
4dcb57d42a Enhanced method lookup in router
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-07-24 12:03:36 -07:00
Vishal Rana
33886c8758 Improved router performance
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-06-05 15:08:32 -07:00
Vishal Rana
80a4b41e16 Fixed build error
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-06-03 16:19:03 -07:00
Vishal Rana
e7c1d5d9fb Not need of Echo.SetMaxParam
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-06-03 15:18:27 -07:00
Vishal Rana
aab17b9f69 Fixed #77
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-06-01 00:07:53 -07:00
Vishal Rana
6d4864ac4f Fixed router tests
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-30 15:40:38 -07:00
Vishal Rana
b9eec15c01 More test coverage
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-30 15:20:36 -07:00
Vishal Rana
e0364caf36 Better handling in middleware for WebSocket
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-22 20:26:52 -07:00
Vishal Rana
13ac746093 Refactored Echo.HandlerFunc, added WebSocket support.
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-20 14:38:51 -07:00
Vishal Rana
7f92fbf3ce Added MiddlewareFunc to the list of supported middleware, #47.
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-10 21:09:28 -07:00