Erik Dubbelboer
1d6a7e0493
The Authorization header should include the Basic keyword
...
Thanks to https://github.com/paween1980
2019-09-27 17:29:44 +02:00
Mike Faraponov
ce02b85a9c
Add ability to set timeout for handshake ( #631 )
...
* Fixed issue with handshake timeout
2019-08-18 14:34:47 +02:00
Erik Dubbelboer
2edabf3b76
Add support for user:pass in URLs ( #614 )
...
Fixes #609
2019-08-18 11:23:33 +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
ea427d2f44
Fix nil Response support in Do* methods
...
Fixes #561
2019-04-11 19:30:20 +02: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
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
Erik Dubbelboer
192515395f
Add Client.NoDefaultUserAgentHeader
2018-11-01 12:44:17 +08:00
Gabriel Pérez S
996610f021
Schema changes detection with HostClient
...
Related with the issue https://github.com/valyala/fasthttp/issues/244
2018-10-14 16:19:09 +03:00
Erik Dubbelboer
c67f81e5f9
Use PostArgs in client
...
See: https://github.com/erikdubbelboer/fasthttp/issues/17
2018-09-20 15:22:18 +08:00
Erik Dubbelboer
7796335d5f
Do case insensitive comparisons for headers and cookies
2018-09-11 20:07:09 +03:00
Erik Dubbelboer
c6fd90e432
Don't suppresses TLS related errors
...
See https://github.com/valyala/fasthttp/issues/300
2018-09-05 20:07:23 +03:00
Erik Dubbelboer
d7688109a5
Reset all fields when releasing a clientConn
...
This fixes a bug where a previous read deadline timer would be reused
for a new connection preventing Client.ReadTimeout from working
properly.
See: https://github.com/valyala/fasthttp/pull/259
2018-09-01 13:20:36 +08:00
Erik Dubbelboer
5576019a85
Fix bug that prevents custom user-agents
2018-08-24 15:31:04 +03:00
Erik Dubbelboer
6fd423aac4
Use and InmemoryListener for TestClientFollowRedirects
...
Prevents travis-ci from throwing:
client_test.go:489: unexpected error: listen tcp4 127.0.0.1:55234: bind:
address already in use
2018-08-18 01:06:36 +08:00
Kirill Danshin
fb5347a023
Merge pull request #231 from erikdubbelboer/testport
...
Use random ports for tests
2018-08-13 00:51:23 +03:00
Aliaksandr Valialkin
b43f17d9a9
Added a test that verifies that the client sends all the request headers and body to the server
2017-09-04 13:47:21 +03:00
Erik Dubbelboer
5afdf7cdfd
Use random ports for tests
...
This should stop travis-ci from constantly failing with
"bind: address already in use"
2017-02-14 14:47:15 +08:00
Aliaksandr Valialkin
b0de56d13b
Properly set "https" scheme in RequestCtx.URI() for TLS connections
2017-01-15 00:26:21 +02:00
Aliaksandr Valialkin
1c39678a4d
client: retry non-idempotent requests if the server closes idle keep-alive connection before receiving the next request
...
This case usually appears when working with Apache or nginx servers.
See http://httpd.apache.org/docs/2.4/mod/core.html#keepalivetimeout
and http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout
2016-11-28 11:50:36 +02:00
Aliaksandr Valialkin
8ab3351f0a
Unshadow err in client test
2016-10-13 17:42:25 +03:00
Aliaksandr Valialkin
93c15ed83c
Remove unused variables
2016-10-13 17:40:57 +03:00
Aliaksandr Valialkin
4ca4d0ea09
Client, HostClient, PipelineClient: verify TLS server name
2016-10-12 19:49:23 +03:00
Aliaksandr Valialkin
07f692d02d
Revert "Redirection support for Do(*Request, *Response)"
...
This breaks Get*() with redirects. DoFollowRedirects must be implemented
on top of Do() instead of hacking on internal doRequestFollowRedirects.
This reverts commit 6438022109 .
2016-10-05 12:44:51 +03:00
Sick Yoon
6438022109
Redirection support for Do(*Request, *Response)
2016-10-05 12:37:18 +03:00
Aliaksandr Valialkin
a52a42acd6
Added HostClient.PendingRequests(), which may be used for balancing load among multiple HostClient instances
2016-09-21 23:03:30 +03:00
Aliaksandr Valialkin
4f66eb3fbb
Do not busy wait on free connection in DoDeadline and DoTimeout, since this may result in a lot of goroutines stalled in the busy wait for free connections
2016-09-12 14:19:13 +03:00
Nicolas Bazire
9f7999be97
fix DoDeadline side effect when no free conn ( #145 )
2016-08-17 20:24:33 +03:00
Aliaksandr Valialkin
881ac52b00
Added support for multiple concurrent connections to server in PipelineClient
2016-07-16 17:36:32 +03:00
Aleksandr Razumov
7304bdd09c
explicitly skip tests for platforms that not support unix sockets ( #90 )
2016-05-05 16:39:31 +03:00
Aleksandr Razumov
0095981a19
fix tests on Windows
2016-05-04 10:08:10 +03:00
Aliaksandr Valialkin
33163198b1
sped up slow tests under 'go test -race'
2016-04-15 13:47:42 +03:00
Aliaksandr Valialkin
316adc4782
PipelineClient.Do: try substituting the oldest request in the pending queue by the current one on queue overflow
2016-04-03 10:58:55 +03:00
Aliaksandr Valialkin
8ae2d3e53c
PipelineClinet: added MaxBatchDelay option
2016-04-02 23:18:34 +03:00
Aliaksandr Valialkin
ca21b21eba
Return ErrPipelineOverflow from PipelineClient.Do if the pending requests' queue is overflown. This should prevent from caller's goroutines leak on stalled pipeline client
2016-04-01 18:21:35 +03:00
Aliaksandr Valialkin
22c9594090
Added PipelineClient for issuing pipelined requests to the server
2016-04-01 18:06:59 +03:00
Aliaksandr Valialkin
e252d37e21
Issue #57 : Added DisableHeaderNamesNormalizing config option to Client and HostClient to be consistent with the corresponding option in Server
2016-02-29 13:11:32 +02:00
Aliaksandr Valialkin
21a70cc5b8
reduced the time required to run tests with race detector enabled
2016-02-21 13:34:55 +02:00
Aliaksandr Valialkin
0ab0d45a50
Eliminated two memory allocations when client follows redirect
2016-02-19 17:27:47 +02:00
Aliaksandr Valialkin
52ddf98cfd
Fixed golint warnings
2016-01-19 12:43:23 +02:00
Aliaksandr Valialkin
81b5321d14
Removed misleading ConnectionCloseReal method from RequestHeader
2016-01-17 00:43:34 +02:00
Aliaksandr Valialkin
92b182c4b1
Added ability to limit the maximum connection duration in HostClient
2016-01-13 14:06:05 +02:00
Aliaksandr Valialkin
c8f577c7f1
Added ability to balance requests among multiple upstream hosts via HostClient
2016-01-12 11:08:24 +02:00
Aliaksandr Valialkin
84e14eb376
Reduced test time for TestClientManyServers
2015-12-25 12:24:40 +02:00
Aliaksandr Valialkin
052a3cfb65
Substitute EqualBytesStr(s, b) by string(b) == s
2015-12-19 20:44:01 +02:00
Aliaksandr Valialkin
f520ed8177
Follow-up tests after the pull request #19 : added missing tests
2015-12-16 20:00:17 +02:00
Aliaksandr Valialkin
7e906e240d
Made TestClientFollowRedirects more robust by adding timeout on Get
2015-11-30 20:39:54 +02:00
Aliaksandr Valialkin
8563a2e762
Follow redirects in client Get* and Post* methods. Added Redirect method to RequestCtx.
2015-11-28 14:47:19 +02:00
Aliaksandr Valialkin
0b2690febe
Added GetTimeout method to client
2015-11-25 13:45:34 +02:00
Aliaksandr Valialkin
48c0f89ee7
Added Stringer implementations to URI, Args and Cookie
2015-11-19 12:51:34 +02:00