* 🔥 v3: update Ctx.Format to match Express's res.format
While the existing Ctx.Format provides a concise convenience method for
basic content negotiation on simple structures, res.format allows
developers to set their own custom handlers for each content type.
The existing Ctx.Format is renamed to Ctx.AutoFormat.
* doc: add docs for Ctx.Format
* refactor: update based on code review feedback
- Rename Fmt to ResFmt
- Add comments in several places
- Return errors instead of panicking in Format
- Add 'Accept' to the Vary header in Format to match res.format
* chore: improve docs and tests for AutoFormat and Format
* ✨ feat: add support for parameters in content negotiation
Attempts to approach the level of support offered by express,
but behavior may differ in unusual corner cases.
Some key behaviors from Express that are implemented:
- If an offer does not have every parameter listed in the given Accept,
it is rejected.
- Parameters do not affect specificity.
- In a given specificity, more parameters gives greater precedence
- Parameters are unordered
- Matching is case-insensitive
- Surrounding quotes for parameter values are stripped
- If an Accept type specifies a parameter more than once, the last
value provided is taken.
- Parameters after q are not processed.
https://www.rfc-editor.org/rfc/rfc9110#name-parameters
* doc: properly attribute reader.go for validHeaderFieldByte
* fix: remove underscores from fuzz test name
* test(forEachParameter): improve coverage
* doc: add comment clarifying RFC 9110 non-compliance for corner case
* Update ctx.md
Added additional information to why GetReqHeaders returns a map where the values are slices of strings (instead of a single string as one might expect)
* Update ctx.md
added the same explanation to GetRespHeaders too
* 11-aryan
* Removed the backticks where no special characters is used
* added backticks to path parameters where special characters are escaped
* Replaced double quotes with backticks in all route parameter strings #2591
* Replaced double quotes with backticks in all route parameter strings #2591
---------
Co-authored-by: René Werner <rene@gofiber.io>
* 🔥 add config to enable splitting by comma in parsers
🔥 add config to enable splitting by comma in parsers
* optimize if statements, remove escape char support
optimize if statements, remove escape char support
* update
* 🔧 feat: Decode body in order when sent a list on content-encoding
* 🚀 perf: Change `getSplicedStrList` to have 0 allocations
* 🍵 test: Add tests for the new features
* 🍵 test: Ensure session test will not raise an error unexpectedly
* 🐗 feat: Replace strings.TrimLeft by utils.TrimLeft
Add docs to functions to inform correctly what the change is
* 🌷 refactor: Apply linter rules
* 🍵 test: Add test cases to the new body method change
* 🔧 feat: Remove return problems to be able to reach original body
* 🌷 refactor: Split Body method into two to make it more maintainable
Also, with the previous fix to problems detected by tests, it becomes really hard to make the linter happy, so this change also helps in it
* 🚀 perf: Came back with Header.VisitAll, to improve speed
* 📃 docs: Update Context docs
* wip
* doc: Improve *fiber.Client section
Enhanced the documentation for the *fiber.Client section, providing
a clear and concise example to help users better understand its usage.
* chore: refactor message about example
* feat: add a variadic parameter on OnListenHandler
* feat: accept a variadic ListenData in startupProcess parameters
* feat: add startupProcess variadic ListenData to function
* refactor: use runOnListenHooks instead of startupProcess for run onListenHooks
* refactor: remove variadic to make codes straightforward
* fix: add listen data to runOnListenHooks
* test: add listenData parameter to OnListen tests
* docs: update OnListen docs
* fix: remove unused codes
* docs: add tabs to onListen hook example
* docs: add if statement to docs example
* docs: replace fmt with log
* docs: fix return value of example
* docs: make 0.0.0.0 string a constant
* fix: change type of TLS from string to bool
* fix: return bool instead of a string
* docs: update example with new TLS type
* fix: change name tls to isTls to prevent shadowing tls variable
* style: make syntax of onListen example shorter
* refactor: remove unused no-lint comment
* refactor: change isTls to isTLS
* fix: add nolint for isTLS bool param
* Update listen.go
---------
Co-authored-by: M. Efe Çetin <efectn@protonmail.com>
* 🚀 FEATURE: add queries method
* 📚 DOCS: add documents for queries method.
* 🩹 Fix: fix wrap error returned from Queries function
* 🚨 tests: add url encoded tests
* 🔥 feature: add url encoded support for queries
* 🩹 Fix: fix wrap error returned from Queries function
* ♻️ Refactor: change error message of url.QueryUnescape
* ♻️ Refactor: refactor of mapping key and value queries
* 🚨 Test: Validate to fail parse queries
* 🚨 Test: Add benchmark test for Queries
* 🩹 Fix: remove parsing for encoded urls
* ♻️ Refactor: change string function to c.app.getString fucntion
Co-authored-by: cmd777 <83428931+cmd777@users.noreply.github.com>
* ♻️ Refactor: change name of benchamark function ctx queries
Co-authored-by: leonklingele <git@leonklingele.de>
* ♻️ Refactor: remove empty lines
Co-authored-by: leonklingele <git@leonklingele.de>
* Revert "♻️ Refactor: change string function to c.app.getString fucntion"
This reverts commit 28febf9e60.
* 📚 Docs: add documents for queries method
* 🚨 Tests: add more tests for queries function
* ♻️ Refactor: change string function to c.app.getString function
* 🚨 Tests: add more test for queries function
* 📚 Docs: add more documents to queries function
---------
Co-authored-by: cmd777 <83428931+cmd777@users.noreply.github.com>
Co-authored-by: leonklingele <git@leonklingele.de>
* ✨ feat(cors): Added new 'AllowOriginsFunc' function.
* feat(cors): Added warning log for when both 'AllowOrigins' and 'AllowOriginsFunc' are set.
* feat(docs): Updated docs to include note about discouraging the use of this function in production workloads.
---------
Co-authored-by: RW <rene@gofiber.io>
Fix typos, and make docs more consistent
This fixes several typos in the ISSUE_TEMPLATES, as well as improve
their readability, also makes the documentation markdowns more
consistent
* docs: added code link to fiber config fields
* docs: added code link to fiber config fields [reference line link updated]
* docs: added code link to fiber config fields [reference line link updated]
* removed reference line link from docs
* docs/api: fix indentation
---------
Co-authored-by: leonklingele <git@leonklingele.de>
* feat: adding to fac sub domain routing
* update: docs to include a example
* Update faq.md
* fix code after tests
---------
Co-authored-by: RW <rene@gofiber.io>
* feature: session only for zero expire cookie #2145
* refactor condition to set MaxAge and Expire on cookie
* move checking zero maxage and expire in session middleware
Signed-off-by: Yves Tumushimire <yvestumushimire@gmail.com>
* feature: session only for zero expire cookie #2145
* refactor condition to set MaxAge and Expire on cookie
* move checking zero maxage and expire in session middleware
Signed-off-by: Yves Tumushimire <yvestumushimire@gmail.com>
* CR changes
* some updates
---------
Signed-off-by: Yves Tumushimire <yvestumushimire@gmail.com>
Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
Co-authored-by: René Werner <rene.werner@verivox.com>