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
Roman Khimov
19fcd40863
Fix chunked streaming ( #1015 )
...
* http: refactor out crlf reading function
Make it a bit simpler and make it reusable.
* streaming: fix chunked stream test
This test is supposed to check for stream unchunking, but it's not really
effective with that because chunks created by createChunkedBody() get wrapped
into another chunk by writeBodyStream(), so we end up with chunkedBody in
request handler although what we really want is plain body.
Deduplicate test and benchmark also.
* streaming: fix Read interface
It wasn't actually compatible with io.Reader as io.Reader _never_ returns n >
len(p) while this function easily did that for chunked payloads confusing its
users:
panic: runtime error: slice bounds out of range [:528] with capacity 512
goroutine 562 [running]:
io.ReadAll(0x9f4380, 0xc0003be1a0, 0xc0004fcd80, 0x0, 0x0, 0xc00086bc30, 0x46f99b)
/usr/lib64/go/1.16/src/io/io.go:634 +0x205
io/ioutil.ReadAll(...)
/usr/lib64/go/1.16/src/io/ioutil/ioutil.go:27
github.com/valyala/fasthttp.getChunkedTestEnv.func1(0xc001fdc680)
/home/rik/dev/fasthttp/streaming_test.go:108 +0x6c
github.com/valyala/fasthttp.(*Server).serveConn(0xc000416d80, 0xa034e8, 0xc0004da880, 0x0, 0x0)
/home/rik/dev/fasthttp/server.go:2219 +0x12ee
github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc000148960, 0xc0003be160)
/home/rik/dev/fasthttp/workerpool.go:223 +0xba
github.com/valyala/fasthttp.(*workerPool).getCh.func1(0xc000148960, 0xc0003be160, 0x8b4ec0, 0xc0003be160)
/home/rik/dev/fasthttp/workerpool.go:195 +0x35
created by github.com/valyala/fasthttp.(*workerPool).getCh
/home/rik/dev/fasthttp/workerpool.go:194 +0x11f
It also returned len(p) in some cases where it read less than that.
2021-05-04 12:55:54 +02:00
Lauris BH
620f0c83ad
Add option for middleware to set custom remote address ( #1009 )
...
* Add option for middleware to set custom remote address
* Update Init2 to clear custom context remoteAddr
v1.24.0
2021-04-23 13:25:02 +02:00
Lauris BH
894272e578
Fix golangci-lint action ( #1010 )
2021-04-23 09:17:45 +02:00
Daniel Firsht
2a6f7db5bb
Adding support for securing error logs ( #1001 )
...
Co-authored-by: Daniel Firsht <firsht@amazon.com >
v1.23.0
2021-03-26 10:46:57 +01:00
Mikhail Faraponov
e61c9d5d3c
Improve Client/HostClient pooling when many HostClient structs created and removed during program execution ( #1000 )
...
* Update client.go
* Update client.go
2021-03-25 22:47:39 +01:00
Mike Faraponov
a5830066b6
Use bytes.IndexByte instead of bytes.Index for single byte lookup ( #999 )
...
* Update uri.go
* Update strings.go
2021-03-20 15:57:57 +01:00
blanet
860c345f10
Fix unexpected panic when calling Do of a PipelineClient ( #997 )
...
* fix: Unexpected panic for PipelineClient
PipelineClient would panic when calling `Do` with a nil Response as
the second parm
This commit fixes the unexpected panic by checking nil first before
setting fields for Response
* Add tests to ensure nil resp is valid for PipelineClient
2021-03-17 21:26:56 +01:00
Vladimir Shteinman
0cd7349686
ImmediateHeaderFlush when no body ( #995 )
2021-03-15 18:10:51 +01:00
kiyon
02e0722fb7
Add PipelineClient name ( #994 )
...
* Improve documentation about DelClientCookie which related with #951 .
* Add pipeline name
2021-03-15 17:46:16 +01:00
peakle
1a7995ba88
format err info ( #989 )
2021-03-05 17:39:17 +01:00
kiyon
f40ea7eb40
Improve socks proxy ( #990 )
...
* Improve documentation about DelClientCookie which related with #951 .
* use proxy.FromURL to support auth
2021-03-05 17:38:59 +01:00
kiyon
34fa9a603f
Add DisableHeaderNamesNormalizing to PipelineClient ( #991 )
...
* Improve documentation about DelClientCookie which related with #951 .
* Add DisableHeaderNamesNormalizing to PipelineClient
2021-03-05 17:38:46 +01:00
Erik Dubbelboer
4637395dd7
Update deps
v1.22.0
2021-02-26 12:04:52 +01:00
kiyon
c3cd5e1554
Export HostClient.connsCount ( #981 )
...
Export HostClient.connsCount
2021-02-25 13:57:48 +01:00
Seva Maltsev
a4b0703152
Implemented DisablePathNormalizing in PipelineClient ( #977 )
2021-02-24 20:48:34 +01:00
Mike Faraponov
0880335533
Update compress.go ( #978 )
...
Add compatibility with flate.Reader to reduce allocations of bufio.NewReader structs backed by default size slices.
2021-02-24 20:43:56 +01:00
Mike Faraponov
e7294d2f70
Update client.go ( #979 )
2021-02-24 20:42:24 +01:00
kiyon
62dfc528ef
Fix Client ms cleaner ( #975 )
...
* Improve documentation about DelClientCookie which related with #951 .
* Fix ms cleaner in Client
2021-02-22 20:19:50 +01:00
Erik Dubbelboer
3cd0862fbb
Streaming fixes ( #970 )
...
- Allow DisablePreParseMultipartForm in combination with
StreamRequestBody.
- Support streaming into MultipartForm instead of reading the whole body
first.
- Support calling ctx.PostBody() when streaming is enabled.
v1.21.0
2021-02-16 21:53:53 +01:00
Darío
1b61ca2e36
Added Protocol() as a replacement of hardcoded strHTTP11 ( #969 )
...
* Added Protocol() as a replacement of hardcoded strHTTP11
* Applied review changes
* Modify h.proto in parseFirstLine
2021-02-16 21:53:40 +01:00
ZhangYunHao
52a8ab65e2
fix s2b go vet warning ( #967 )
2021-02-12 10:47:38 +01:00
AlphaBaby
a88030b8fb
fix gracefilly shutdown bug, issue #958 ( #960 )
...
* fix gracefilly shutdown bug, issue #958
* fix golangci-lint
* add option: CloseOnShutdown into Sever
* Update server.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
* Update server.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
Co-authored-by: fujianhao3 <fujianhao3@jd.com >
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
v1.20.0
2021-02-07 21:13:36 +01:00
Erik Dubbelboer
1494fdc53b
Fix clientGetURLDeadline
...
Based on https://github.com/valyala/fasthttp/pull/962
Make sure req is always released and fix a race condition.
2021-02-07 20:25:33 +01:00
Kirill Danshin
0956208cc6
Add request body streaming. Fixes #622 ( #911 )
...
* Add request body streaming. Fixes #622
* Add test cases for StreamRequestBody
Co-authored-by: Kiyon <kiyonlin@163.com >
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
Co-authored-by: Fiber
2021-02-06 23:03:23 +03:00
Erik Dubbelboer
fbe6a2d470
Add fasthttp.GenerateTestCertificate and use in tests
...
Remove ssl-cert-snakeoil so our tests don't fail in 2025.
2021-02-06 11:47:11 +01:00
Erik Dubbelboer
838d3abc3d
Allow concurrent ServeTLS
2021-02-06 10:53:30 +01:00
Erik Dubbelboer
3cec26d42d
Allow stopping FS handler cleanup gorountine ( #942 )
...
* Allow stopping FS handler cleanup gorountine
* CleanStop
2021-02-06 10:22:14 +01:00
Erik Dubbelboer
ed1cedd51e
Fix race condition in Client.DoTimeout
2021-02-06 10:20:15 +01:00
kiyon
5661df8bbd
Improve documentation about DelClientCookie which related with #951 . ( #956 )
2021-01-27 17:18:23 +01:00
Mike Faraponov
b4b40e9363
Do not start connsCleaner on SetConnectionClosed requests. ( #950 )
...
* Update client.go
* Update client.go
2021-01-22 22:22:19 +01:00
Erik Dubbelboer
70e00dc4f3
Ignore empty Transfer-Encoding headers
...
Don't default to chunked. If we have a Content-Length header we have a fixed body.
2021-01-06 19:18:12 +01:00
anshul-jain-aws
6234776e7c
Use QueryString while constructing RequestURI instead of QueryArgs if parsedQueryArgs is set to false ( #937 )
v1.19.0
2021-01-02 21:14:25 +01:00
Erik Dubbelboer
245e7ecded
CloseIdleConnections should also close TLS connections
2020-12-31 11:37:29 +01:00
Erik Dubbelboer
bd3513389d
Always set Keepalive options
...
Different versions of Go have different defaults, so we just always set
what the user configured.
2020-12-26 17:01:19 +01:00
Erik Dubbelboer
4e63057c0f
Make argsKV more predictable
...
Fixes #932
2020-12-26 16:53:48 +01:00
Kirill Danshin
d0dfbd4494
fix issue #875 ( #909 )
...
* 🐞 panic in fs.go #824
* fix issue #875
Signed-off-by: Kirill Danshin <kirill@danshin.pro >
* improve issue 875
Co-authored-by: Fenny <fenny@gofiber.io >
* Update header.go
* Update header.go
Co-authored-by: Kirill Danshin <kirill@danshin.pro >
* remove foldReplacer
* Improve removeNewLines
Start replacing at the first character found, use bytes.Indexbyte to
make the function signature more logical. Both bytes.indexByte and
strings.IndexByte use exactly the same code:
https://github.com/golang/go/blob/0c703b37dffe74d3fffc04347884bb0ee2fba5b3/src/internal/bytealg/indexbyte_amd64.s#L8-L20
Co-authored-by: wernerr <rene.werner@verivox.com >
Co-authored-by: wernerr <rene@gofiber.io >
Co-authored-by: Fenny <fenny@gofiber.io >
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com >
v1.18.0
2020-12-09 16:59:57 +01:00
Daniel Kürner
ec4aa43642
(header) do case insensitive lookup of cookie header value ( #925 )
...
Since some proxies might send i.e. a lowercase cookie header value, let´s do the lookup in a case insensitive way
2020-12-08 17:26:25 +01:00
anshul-jain-aws
f710c2d320
Fixing deletion of headers/queryargs having multiple values. ( #918 )
2020-11-24 09:18:38 +01:00
kiyon
cb0aaaa266
Improve round2 performance ( #914 )
2020-11-19 17:52:42 +01:00
Shohi Wang
c2542e5acf
add nil check for LocalAddr ( #907 )
2020-11-07 08:39:47 +01:00
asellappen
30aa43e12a
Adding Power support(ppc64le) with continuous integration/testing to the project for architecture independent ( #903 )
...
* Adding Power support(ppc64le) with continuous integration/testing to the project for architecture independent
* Adding ower on support to the package as CI
removed comment Adding power on support ,Pls merge now
2020-11-06 15:25:20 +01:00
Erik Dubbelboer
df87e7089a
Fix race condition in TestCloseIdleConnections
...
On really slow machines. when the test takes longer than 10 seconds,
mCleaner can already delete the connection from the map before we
check it again.
2020-11-06 12:00:12 +01:00
Erik Dubbelboer
74bd13a169
Add ppc64le support
v1.17.0
2020-11-05 09:32:07 +01:00
Erik Dubbelboer
00973e5c0a
Don't use %w
...
We support versions of Go that don't have this yet.
2020-11-03 20:43:44 +01:00
Maxim Korolyov
d7752d2a70
fixed default schema for for req url ( #897 )
2020-11-02 22:24:57 +01:00
Erik Dubbelboer
ce7b94fee9
Add Request.SetBodyRaw
...
Fixes https://github.com/valyala/fasthttp/issues/891
2020-11-02 22:22:01 +01:00
Erik Dubbelboer
d71fc6c2c0
Ignore *.fasthttp.br files from tests
2020-11-02 22:21:43 +01:00
Maxim Korolyov
9697ccb834
Added httpproxy v2 ( #889 )
...
* httpproxy v2 with improved auth barrier storage and full https proxy support
* fixed package name
* moved back the env proxy
2020-10-29 21:05:59 +01:00
Mohammad Alian
9ed328c168
remove unnecessary type conversion ( #890 )
...
Co-authored-by: Mohammad Alian <ts-mohammad.alian@rakuten.com >
2020-10-29 20:53:41 +01:00