Commit Graph

28 Commits (e49880c5d6ac4abee7d5a0fbda857ebef01bc21f)

Author SHA1 Message Date
RW ff1e0109a3
Closes #1931 "🤗 How to get path param before a custom verb?" (#1983)
* Add possibility for parameters before custom verb
FIX for "🤗 How to get path param before a custom verb? #1931"

* try to stabilize the tests
2022-07-27 08:37:03 +02:00
Sujit Baniya 3bb4b7ed41
Fix GetLocationFromRoute bug for optional params (#1922)
* Add Global Layout for view render

* Add test case for Views Layout

* Update ctx_test.go

* Add App Name function to pass custom app name

* Remove json tag for function

* Change func to string

* Add test for AppName

* Add RedirectToRoute and RedirectBack with fallback if referer in header not found

* replace errors.New with fmt.Errorf

* simplified code

* Add tests for different formats

* Add method to get route location and add benchmarks

* Add ToString function

* Fix error

* rearrange case for fmt.Stringer

* Fix bug for error return

* Lock latest route for app.Name(namee string)

* decreasing timeout for client test with timeout

* remove println and adjust condition to > 0

* Change name to get route url

* Change name to get route url

* Update ctx.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>

* Fix bug on getting url for optional and greedy params

* Fix greedy pattern

* This PR will fix #1921 (comment).

The optional and greedy params were not fetched correctly

* This PR will fix #1921 (comment).

The optional and greedy params were not fetched correctly

* This PR will fix #1921 (comment).

The optional and greedy params were not fetched correctly

Co-authored-by: RW <rene@gofiber.io>
Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
2022-05-31 13:58:13 +02:00
Gusted 7b7dcf29f7
♻️ Tidy up the codebase (#1613)
* run gofmt

* add t.Helper()

* Simplify assigns

* Simplify make operation

* Remove unused field in struct

* Fix typo

* Run gofumpt ./

* Consistent spacing

* len(...) can never be negative

* Use ReplaceAll

* Simplify operation

* Remove deadcode

* Fix typo

* Tidy up `} else { if ...`

* Fix AssertEqual

* Remove t.Helper() to fix go1.14.15
2021-11-05 08:00:03 +01:00
RW 87b0a15f1e
Fix - prevent panic on GetTrimmedParam (#1593)
Close #1587
2021-10-25 07:25:31 +02:00
Javad Rajabzade 7609117cec
Improved some conditions (#1386)
* simplify `u <= (1<<7)-1` to `u < (1 << 7)`

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* Instead Bool comparison can using simplified bool check if !var = false checking

* Unnecessary use of fmt.Sprintf for value without format

* For check condition two value not required ! method

* nil check may not be enough for slice, better check with len

* function parameters combined

* When the form returns error information, the text content should not start with a capital letter or end with a punctuation mark

* error var invalidPath should have name of the form errFoo, It is recommended that the error variables that are part of an API should be named

* change to condition len(x), it's faster https://github.com/gofiber/fiber/pull/1386#discussion_r652369520

* Update write.go

* Update write_bytes.go

* Update store.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-17 22:03:59 +02:00
RW 033184938c
🚀 new possibility to escape special routing parameters (#1280)
* 🚀 new possibility to escape special routing parameters, which gives the possibility to follow the google api design guide https://cloud.google.com/apis/design/custom_methods

* 🚀 new possibility to escape special routing parameters, which gives the possibility to follow the google api design guide https://cloud.google.com/apis/design/custom_methods
2021-04-12 21:45:24 +02:00
ReneWerner87 b51def0bb8 🐛 UnescapePath not working #1102
Co-authored-by: Fenny <fenny@gofiber.io>
2021-01-06 13:21:54 +01:00
ReneWerner87 9b69bdadc8 🐛 Fix wrong route matching for not greedy parameter
#1016

Co-authored-by: Fenny <fenny@gofiber.io>
2020-11-13 16:17:48 +01:00
Fenny 9fd68c62b0 ✏ update comments 2020-09-29 21:49:50 +02:00
Fenny b96cbff310
Merge pull request #774 from Fenny/master
👂 uncomment internal benchmarks
2020-09-14 12:15:24 +02:00
Fenny 2768ea2a77 🙌 make utils public
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-09-14 12:12:29 +02:00
ReneWerner87 a828c5d0e8 🪓 Code separation for utils (🧹clean code)
Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: Kiyon <kiyon@gofiber.io>
2020-09-14 10:30:35 +02:00
ReneWerner87 712b585b9d 🪓 Code separation for utils (🧹clean code)
Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: Kiyon <kiyon@gofiber.io>
2020-09-14 10:23:22 +02:00
Fenny a3cac71ae8 🔦 move utils to internal 2020-09-14 09:09:06 +02:00
Fenny ec5d66e7a8 v2 2020-09-13 11:20:11 +02:00
ReneWerner87 053d463fa6 🚀 improve routing behavior 2020-08-10 10:14:17 +02:00
ReneWerner87 67caca823b 🚀 improve routing behavior 2020-08-10 09:50:53 +02:00
ReneWerner87 cff454dfc2 🚀 improve routing behavior 2020-08-09 22:05:14 +02:00
ReneWerner87 d9c09fa68e 🚀 improve routing behavior 2020-08-09 19:50:10 +02:00
ReneWerner87 b8ca4c9b8a 🚀 improve routing behavior 2020-08-07 21:42:53 +02:00
ReneWerner87 2283fd2756 🚀 improve routing behavior 2020-08-07 14:38:40 +02:00
ReneWerner87 582b10a6d4 🚀 improve routing behavior 2020-08-06 02:43:58 +02:00
ReneWerner87 8c4f346a33 🚀 improve routing behavior 2020-08-06 02:39:47 +02:00
ReneWerner87 a1148391ea 🚀 improve routing behavior 2020-08-06 02:36:05 +02:00
kiyon 96371a2869 💯 improve path.go coverage 2020-07-09 15:51:04 +08:00
Fenny 30ca24140f 🚗 Prepare regex patterns 2020-07-06 17:59:26 +02:00
Fenny e745960330 Add ReadBufferSize & WriteBufferSize 2020-06-15 13:36:50 +02:00
wernerr e674d679df move path matching and registration in separate file "path.go" 2020-06-14 12:37:09 +02:00