Commit Graph

1156 Commits

Author SHA1 Message Date
Rem 9ba4cef1ba Support SameSite value "None" cookie attribute (#581)
* Support SameSite value "None" cookie attribute

* Fix typo in CookieSameSiteNoneMode comment

* fix comment for SameSite None
2019-06-14 16:07:33 +02:00
losingle 9494955f8e ADD TimeoutWithCodeHandler support (#589)
* ADD TimeoutWithCodeHandler support

* FIX description
2019-06-06 17:17:40 +02:00
Maxim Lebedev d3715c361c Used Headers constants instead raw strings 2019-05-28 18:04:24 +03:00
Maxim Lebedev a4505cb573 Added headers keys constants 2019-05-28 18:04:24 +03:00
Erik Dubbelboer f14dea7633 Option for immediate header flush (#575)
* Option for immediate header flush

* Export struct var and add specs
2019-05-28 10:47:45 +02:00
Erik Dubbelboer 20ea781823 Add warning to RequestCtx.Error
Fixes #578
2019-05-28 10:46:25 +02:00
Erik Dubbelboer 1ee3b845b6 Fix Client.DoTimeout race condition 2019-05-23 13:15:14 +02:00
Vladimir Shteinman 74ad0f8e9b Export struct var and add specs 2019-05-22 23:23:02 +03:00
Kirill Danshin c754e0ffba Create SECURITY.md 2019-05-21 13:49:02 +03:00
Vladimir Shteinman 9551d9544d Option for immediate header flush 2019-05-18 17:04:30 +03:00
xyb 46469b532d Fix comment. (#571)
Signed-off-by: Xiao YongBiao <xyb4638@gmail.com>
v1.3.0
2019-05-15 08:31:18 +02: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
Erik Dubbelboer 15dbe35bb5 Timing fixes (#564)
- Improved timing code to be much cleaner
- Add IdleTimeout
- Remove obsolete optimization (was fixed in Go 2 years ago: https://github.com/golang/go/issues/15133#issuecomment-271571395)
2019-04-29 16:12:47 +03:00
Erik Dubbelboer ed16dc07fd Fix go test -bench 2019-04-13 23:17:55 +02:00
Erik Dubbelboer ea427d2f44 Fix nil Response support in Do* methods
Fixes #561
2019-04-11 19:30:20 +02:00
Kirill Danshin 517df88332 added option to keep hijacked connection open (#550)
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
2019-03-02 23:01:48 +03:00
Kirill Danshin 2d52ea9ef5 enable 1.12 support
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
2019-03-02 09:20:34 +03:00
Kirill Danshin 64c234a44a reset request before ctx release; fixes #548
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
2019-03-02 09:14:45 +03:00
Ciprian Dorin Craciun 733a6505a9 Support huge read-only []byte response bodies (#477)
* Add `Response.SetBodyRaw` method that serves a `[]byte` slice without touching it  (as an alternative to `SetBody`)
* Update various response related functions that are impacted after the incoduction of `Response.bodyRaw`
* Add a few test-cases in relation to `Response.SetBodyRaw`
2019-02-24 08:32:54 +00:00
xuecai ed3793a1e1 add tests for copyto (#545)
* add tests for copyto
* add HeaderCopy Test reflect.DeepEqual
v1.2.0
2019-02-17 10:11:45 +00:00
Erik Dubbelboer 6453619524 Remove methods that had been deprecated in 2015 2019-02-16 15:10:39 +01:00
Tiago Peczenyj 0558e349d7 fix context Err() issue (#544)
* fix context Err() issue

Co-Authored-By: peczenyj <tiago.peczenyj@gmail.com>
2019-02-16 10:53:21 +00:00
Sergio Andrés Virviescas Santana 7ace827541 Add Kratgo to related projects (#543)
* Add Kratgo to related projects
2019-02-16 10:51:04 +00:00
xuecai 10b98c2cdf add conn's address info in Response (#537)
* reset commit
* fix response copy bug; add tests;
2019-02-16 10:50:14 +00:00
Erik Dubbelboer 61039c93c2 Add zero allocation guarantee tests 2019-02-12 21:26:41 +01:00
Erik Dubbelboer 02b7301203 Fix TechEmpower performance degradation
Fixes #533
2019-02-12 20:34:43 +01:00
Erik Dubbelboer e722d81dc9 Fix HostClient.MaxConns 2019-02-11 21:12:32 +01:00
Erik Dubbelboer 8b58c26960 Fix ReduceMemoryUsage 2019-02-09 11:30:22 +01:00
Erik Dubbelboer 6647cb2885 Remove duplicate check
We already compare headers case insensitive so we don't need to compare
two different cases.
2019-02-09 11:29:47 +01:00
Okunev Yu Dmitry fa7a110f3e An atomic approach for HostClient.MaxConns (#531)
An atomic approach for HostClient.MaxConns
2019-02-07 21:37:59 +00:00
Nikolay Markov 71e7652440 SkipBody is propagated to Response copy (#532) 2019-02-06 12:36:43 +03:00
Erik Dubbelboer 45548243d7 Add TCPDialer 2019-02-04 09:11:02 +00:00
xuecai 627d63dd25 change timer to public api #525 (#527)
* change acquireTimer and releaseTimer to public api
2019-02-03 19:16:39 +00:00
Erik Dubbelboer aaec9b0fe2 Make InmemoryListener.Dial return when the connection is accepted
This makes InmemoryListener deterministic which makes our tests much
less flacky under high load or when GOMAXPROCS=1
2019-02-02 23:40:05 +01:00
Erik Dubbelboer 51532b9517 Shutdown close channel returned by RequestCtx.Done
RequestCtx.Done() now returns a channel that will be closed when
Server.Shutdown() is called.
2019-02-02 12:23:32 +01:00
Shulhan 9574c37fb8 Various changes regarding code readibility (#523)
* all: use sort.Strings when applicable

Basically, sort.Strings is the shortcut of Sort(StringSlice(a)) but its
more readable.

* all: replace string(bytes.Buffer.Bytes()) with bytes.Buffer.String()

Although its only occured on test files, it may be worth to simplified it.

* http_test: simplify strings.Index with strings.Contains

Both have the same O(n), but strings.Contains more readable on
if-condition.

* args: simplify if-condition check on boolean value

* all: simplify variable initialization

If we assign the variable after declaring it, we can simplify it using
":=" operator or "= value".
The reader can still known the type of variable from the struct name or
variable type before assignment operator.
2019-02-02 11:13:33 +00:00
Shulhan 2f22f20f02 all: fix typo on comments
While at it wrap comments with long lines.
2019-01-30 21:50:28 +01:00
Shulhan 4c53f113c5 all: pre-allocated slice with possible known size
This fix is based on suggestion of "prealloc" static analysis tool [1].

Per note of the tool's author suggestion, its recommended to allocate the
slice length/capability, if we known their possible size.  This is to
minimize "append" to re-allocate the slice underlying array.

[1] https://github.com/alexkohler/prealloc
2019-01-30 20:42:28 +01:00
Erik Dubbelboer 5de7a833de Add warning to DoTimeout 2019-01-26 22:26:59 +01:00
Erik Dubbelboer c3ff460e02 Detect 308 as redirect status code
Same as net/http does.
2019-01-19 15:13:27 +01:00
xuecai c88be72d77 add method Sort in args (#505)
* add method StringSort QueryStringSort AppendBytesSort in args

* simplify code

* only Sort method

* format

* add method StringSort QueryStringSort AppendBytesSort in args

* simplify code

* only Sort method

* format

* merge and fix tests

* change sort into generic by having the sort function

* change sort into generic by having the sort function

* change comment
v1.1.0
2019-01-04 18:38:56 +03:00
Erik Dubbelboer 9793e28938 Add test for ConnState 2019-01-03 22:23:27 +01:00
xuecai 4fb459a45e fix args empty string be changed to boolen (#502)
Add support for empty args
2018-12-30 19:56:58 +01:00
Erik Dubbelboer 2f131ba2b2 Add RequestHeader.VisitAllInOrder 2018-12-27 02:05:20 +03:00
Matt Reyer 62dcd6fdce Support SameSite cookie attribute (#488)
SameSite cookie attribute implementation.
2018-12-13 21:34:49 +06:30
Okunev Yu Dmitry caea86794c Added method (*Server).GetOpenConnectionsCount() and option DisableSleepWhenConcurrencyLimitsExceeded (#485)
* Change sleep when concurrency limits exceeded.
* Added method (*Server).GetOpenConnectionsCount()
2018-12-13 20:03:52 +06:30
Blless 1d2d99cba3 Add MaxIdemponentCallAttempts to fasthttp.Client (#484)
* Add MaxIdemponentCallAttempts to fasthttp.Client
2018-11-29 16:36:36 +06:30
Erik Dubbelboer 5836521d82 Use case-insensitive header value comparison
Fixes #483
2018-11-29 17:45:35 +08:00
amezghal abdelilah 8be35c8fb8 cleanup resources 2018-11-28 11:57:58 +06:30
amezghal abdelilah a3c314e4a3 cleanup 2018-11-28 11:57:58 +06:30