Erik Dubbelboer
2272d532e1
Reimplement flushing support for fasthttpadaptor ( #2081 )
...
Use a simpler implementation, and do more tests.
Instead of https://github.com/valyala/fasthttp/pull/2069
2025-10-06 03:22:13 +02:00
Giovanni Rivera
e04490f830
Add flushing support to fasthttpadaptor ( #2054 )
...
* Add flushing support to fasthttpadaptor
* refactor(fasthttphandler): Fix comment typos
* refactor(fasthttphandler): Fix early closing of net/http handler
* refactor(fasthttphandler): Apply requested changes
* refactor(fasthttphandler): Reduce memory allocations by using sync.Pool
* refactor(fasthttphandler): Fix improper releaseNetHTTPResponseWriter
* refactor(fasthttphandler): Add buffer sync.Pool with panic assert
* refactor(fasthttphandler): Fix hijacked-related response writer race condition
* refactor(fasthttphandler): Rename bufW to bufRW
* refactor(fasthttphandler): Ensure proper responseMutex use
* refactor(fasthttphandler): Specify minBufferSize to ensure reading 32 KiB chunks in streaming mode
* refactor(fasthttphandler): Fix release logic
* refactor(fasthttphandler): Fix handlerConn race condition
* refactor(fasthttphandler): Explicitly ignore handlerConn close error
* refactor(fasthttphandler): Use sync.Once, sync.Cond, and a single channel for mode management
* refactor(fasthttphandler): Remove commented code
* refactor(fasthttphandler): Add period to respect linter
* refactor(fasthttphandler): Remove return else clauses to respect lint
2025-09-11 17:36:02 +02:00
Erik Dubbelboer
28ebbd9bf1
Drop support before go1.20 ( #2022 )
...
We still had old implementations of s2b and b2s that didn't require
unsafe.StringData and unsafe.SliceData that were added in go1.20. Since
we don't support go1.20 anymore we can drop these functions.
2025-06-15 05:14:07 +02:00
Kashiwa
a1783ffacc
feat: Add iter.Seq2 iterator #2010 ( #2011 )
2025-05-18 13:23:04 +02:00
Sigmund Xia 夏天睿
65e989e8b8
Fix improper memory reuse in NewFastHTTPHandler ( #1860 )
...
* add test which will cause error
* rename test
* fix improper memory reuse in NewFastHTTPHandler
* move deep copy from VisitAll to f
* copy value string only for cookie
2024-09-10 20:05:52 +02:00
Juan Calderon-Perez
1fb3453165
Use Named Fields and Align Structures to Reduce Memory Usage ( #1814 )
...
* Use Named fields and Align Structures to Reduce Memory Usage
* Remove extra spaces
2024-08-02 22:26:52 +02:00
Oleksandr Redko
190204cf1a
Upgrade golangci-lint to v1.56.2; fix gocritic issues ( #1722 )
2024-02-21 05:51:28 +01:00
gilwo
aefd080674
adaptor ResponseWriter - adding Hijack method and pass proper fields ( #1525 )
...
* adding hijack method and pass proper fields
* adding hijack method and pass proper fields - adding tests
* improve hijack handling, use proper test for hijacking
* extend hijackhandler propogation to NewFastHTTPHandlerFunc
* align hijacking of fasthttp adaptor net request with fasthttp request, safe conn handling for proper release of resources and custom hijack handler for more controlled by hijacking implementation
* Implement actual behaviour of net/http Hijacker
---------
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
2024-02-17 14:51:38 +08:00
Oleksandr Redko
f196617f55
chore: Use 'any' instead of 'interface{}' ( #1666 )
...
gofmt -w -r "interface{} -> any" -l .
2023-11-24 11:33:04 +01:00
Oleksandr Redko
7bd632cbde
chore: Remove redundant build constraint ( #1650 )
2023-11-08 23:18:13 +01:00
Erik Dubbelboer
0e99e64ee8
Update golangci-lint and gosec ( #1609 )
2023-08-26 12:49:17 +02:00
Oleksandr Redko
b334443d63
docs: add missing dot to ConvertRequest comment ( #1516 )
2023-03-14 22:37:04 +01:00
Oleksandr Redko
e15a810a98
docs: fix grammar issues and typos in comments ( #1492 )
2023-02-13 10:43:44 +08:00
Oleksandr Redko
934f04e330
Refactor golangci-lint config and remove redundant nolints ( #1486 )
...
* Refactor golangci-lint config
- Use golangci-lint-action for GitHub workflow.
- Add additional golangci-lint run options.
- Remove unused nolint directives.
* Revert exclude-use-default option
2023-02-11 15:35:15 +08:00
Shawn
9b4a7e5bf4
fix http2 adapter ( #1457 )
2022-12-25 10:07:22 +01:00
kinggo
2c8ce3b40e
feat: add header.PeekAll ( #1394 )
2022-10-15 15:47:53 +02:00
kinggo
bcf7e8e944
test: merge test in adaptor_test.go ( #1381 )
...
* test: merge test in adaptor_test.go
* Fix lint
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
2022-09-18 09:20:03 +02:00
Emre Savcı
40eec0b706
byte to string unsafe conversion in fasthttpadaptor ConvertRequest method ( #1375 )
...
* add byte to string unsafe conversion to fasthttpadaptor ConvertRequest method()
* add nosec comment line
* Update fasthttpadaptor/request.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
* move unsafe package import next to std packages
* fix lint error in test
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
2022-09-15 23:15:26 +03:00
Aoang
a696949f6c
Deprecate Go 1.15 ( #1379 )
...
* Dropping support for 1.15.
* Replaces Go 1.16 Deprecated functions
* Update test build flag
* Fix import sort and comment
* Update github.com/klauspost/compress to v1.15.9
https://github.com/klauspost/compress improved performance and changed Minimum version is 1.16, this should be the final supported release for Go 1.16 (https://github.com/klauspost/compress/commit/6d0019a95afa3221f7522d1f2eed0033b5e79470 ) .
2022-09-15 22:28:25 +03:00
Qing Moy
af94725d11
Reduce slice growth in adaptor ( #1356 )
2022-08-16 10:28:42 +02:00
Aoang
ea6052464e
Add Go 1.19 Support ( #1355 )
...
* Update Go Version to Go1.19.x And add cache
* Fix CI Line endings
* Update test CI Go Version to Go1.19.x And add cache
* Update Gosec Security Scanner CI to securego/gosec@v2.12 .0
* Format comment
Go 1.19 adds support for links, lists, and clearer headings in doc comments. As part of this change, gofmt now reformats doc comments to make their rendered meaning clearer. See “Go Doc Comments” for syntax details and descriptions of common mistakes now highlighted by gofmt. As another part of this change, the new package go/doc/comment provides parsing and reformatting of doc comments as well as support for rendering them to HTML, Markdown, and text.
ref: https://tip.golang.org/doc/go1.19
ref: https://tip.golang.org/doc/comment
* Fix doc structure
2022-08-14 11:31:57 +02:00
Erik Dubbelboer
7a5afddf5b
Use %v for errors and %q for strings ( #1262 )
...
Mostly in tests.
2022-04-01 18:11:16 +02:00
Erik Dubbelboer
9f2c63676d
Lower go test time
2021-06-18 14:57:18 +02:00
Erik Dubbelboer
6233fbc08e
Fix header .Add functions ( #1036 )
...
These functions should take the headers that are handled differently
into account.
2021-06-01 10:52:35 +02:00
Sergio Andrés Virviescas Santana
7d13e18a4f
Add Request.TLS and try to avoid a new alloc if Request.Header is already allocated ( #1034 )
2021-05-26 09:06:37 +02:00
Nícolas Barbosa
04cde74c41
feature: add ConvertRequest func ( #1024 )
...
* feature: add ConvertRequest func
To easy method to convert ctx.RequestCtx to http.Request
* chore: minor changes by code review #1024
2021-05-17 09:20:10 +02:00
Juan Chan
b2f111bd98
Fix(adaptor): Fixed an issue where the adapter did not convert all ( #1021 )
...
values of the header successfully when converting the header.
2021-05-11 09:58:25 +02:00
Erik Dubbelboer
34a61fe63f
Update linting ( #851 )
2020-07-17 14:22:28 +02:00
Erik Dubbelboer
ef51a7e590
Fix fasthttpadaptor Content-Type detection
...
Make this in line with how net/http handles Content-Type.
2020-06-21 11:09:08 +02:00
Lovro Mažgon
8d8443d77c
Forward context in fasthttpadaptor ( #720 )
...
* forward context in fasthttpadaptor
* run go fmt
2020-01-10 16:41:16 +01:00
Erik Dubbelboer
32793db72d
Run golangci-lint using a Github Action
2019-11-16 18:09:28 +01:00
Maxim Lebedev
d3715c361c
⚡ Used Headers constants instead raw strings
2019-05-28 18:04:24 +03:00
Maxim Lebedev
f544170d63
Added methods constants ( #567 )
...
* ✨ Added methods constants
* 👌 Fixed methods comment due to review changes
2019-05-06 17:54:49 +02:00
Aliaksandr Valialkin
930362b9f8
go vet fix
2016-09-27 20:01:51 +03:00
Victor Gaydov
97d96cb3b7
Handle TransferEncoding in fasthttpadaptor ( #124 )
...
When incoming http.Request is constructed, "Transfer-Encoding" header
is removed, and http.Request.TransferEncoding is set instead.
This behaviour is now emulated in fasthttpadaptor.
2016-06-29 17:36:40 +03:00
Aliaksandr Valialkin
2af858a7da
Follow-up for pull request #42 : properly initialize Request.URL field
2016-01-28 11:31:53 +02:00
Zviad Metreveli
8b7405a861
add missing import
2016-01-27 19:07:56 -05:00
Zviad Metreveli
4fd339e8c5
fix fasthttpadaptor to work with http.ServeMux in Go 1.5
2016-01-27 19:02:42 -05:00
Aliaksandr Valialkin
d53b8f0f3c
Added net/http -> fasthttp converter for quick and easy switching to fasthttp
2016-01-06 17:11:43 +02:00